Files
pnoker dc2164f46e fix(driver): repair boot, scheduling and registration regressions
a live-stack sweep of all 36 drivers surfaced five sdk-level defects
that left reads dead or the whole fleet unbootable:

- drop the empty spring.main stub in the shared driver profile; the
  boot 4.1 binder rejects null-valued keys and every driver died at
  startup with a bind exception
- rename the schedule enable flag to enable to match what every driver
  application.yml actually spells; with the old enabled key the read
  and custom quartz jobs were silently never scheduled
- treat proto3 zero-versions as unset when reconciling registration
  so a driver restart re-registers instead of failing the optimistic
  lock with 'driver version conflict'
- ignore the driver's own registration event that can be consumed
  before applymetadata finishes instead of logging an error
- initialize jdbc/serial connection maps eagerly: the registration
  event handler invalidates pools and nped on a lazy-null map
- ble: exclude the guava 18 pin dragged in by bluetooth-manager
- kafka: use the starter (boot 4 split autoconfigurations out of the
  bare jar) and read the compose-provided bootstrap variable
- lwm2m: pin californium to the 3.x api leshan m14 needs and
  configure an explicit coap endpoint
- mqtt: replace the orphaned spring-integration gateway with a paho
  publisher so the send path exists again
- boot sweep result: 36/36 drivers start, 0 errors
2026-09-18 09:48:19 +08:00
..

DC3 Driver CAN

Overview

dc3-driver-can is the CAN bus driver of the IoT DC3 platform. It is intended to read and write CAN frames on a SocketCAN interface, parsing frame payloads into device point values and sending command frames to the bus.

⚠️ Work in progress. This driver is a skeleton — its class documentation explicitly states "Protocol-level I/O is not yet fully implemented" and there are TODO markers in the method bodies (e.g. native SocketCAN JNI integration is not done). The current read()/write() path shells out to Linux can-utils (candump/cansend) and health() checks the interface via ip link show. Treat it as a starting template, not a production-ready driver.

Module Information

  • Group ID: io.github.pnoker
  • Artifact ID: dc3-driver-can
  • Driver Name: CAN Bus Driver

Driver Attributes (Device-level)

Attribute Description
Interface CAN interface name (e.g. can0)
Bitrate CAN bus bitrate
Frame Format STANDARD (11-bit) or EXTENDED (29-bit)

Point Attributes

Attribute Description
CAN ID CAN identifier to match
Data Offset Byte offset within the frame payload
Data Length Number of bytes to read
Data Format INT / UINT / HEX
Byte Order Byte order (e.g. LITTLE)
Request CAN ID CAN ID for an optional request frame
Request Data Payload of the optional request frame

Command Attributes (write)

Attribute Description
CAN ID CAN identifier to write to
Data Frame data (supports ${value})

The module application.yml is authoritative for attribute codes, types, default values, scheduling, health, and local buffering. Keep this README aligned when those user-facing settings change.

Prerequisites

A Linux host with an available SocketCAN interface (e.g. can0) and the can-utils package installed (candump, cansend), reachable from the driver process.

Running Locally

1. Start Infrastructure and Center Services

make up-db
make up-dev GROUP=core

2. Build and Run

mvn -s .mvn/settings.xml -pl dc3-driver/dc3-driver-can -am package
java -jar dc3-driver/dc3-driver-can/target/dc3-driver-can.jar

Testing

Run the module tests from the repository root:

mvn -s .mvn/settings.xml -pl dc3-driver/dc3-driver-can -am test
  • dc3-common-driver — Driver SDK for registration, scheduling, and RabbitMQ integration