can_bus_toolkit 0.1.0
can_bus_toolkit: ^0.1.0 copied to clipboard
CAN bus toolkit for Android over USB OTG: PCAN-USB and SLCAN adapters, candump logging, ISO-TP, OBD-II and UDS clients, and DBC signal decoding.
0.1.0 #
Initial release. Android only. Requires API 24 or later.
core #
CanFrame,CanId,CanConfig,CanBitrate(10 kbit/s to 1 Mbit/s),CanFilter, and theCanBusinterface with periodic sending.VirtualCanBusandVirtualCanNetwork, with optional ACK and bitrate-mismatch simulation.- Bus statistics: frames per second, per-ID rates, error and dropped counts, and bus load with worst-case bit stuffing.
candump -Lreader and writer, andCanLogReplayer. The replayer skips diagnostic frames by default.
usb #
- USB OTG transport for PEAK PCAN-USB, and for SLCAN and gs_usb adapters (experimental).
- Listen-only mode, hardware timestamps, error counters and bus state where the
adapter supports them.
UsbCanBus.capabilitiesreports what the device supports. - Device attach and detach events, the USB permission flow, and optional auto-reconnect.
- Native frame batching with a bounded queue and a dropped-frame counter.
- Background candump logging from an app-declared
connectedDeviceforeground service. CanUsb.registerDevicefor clone adapters.
obd #
- ISO-TP (ISO 15765-2) channel with flow control, block size, STmin and padding.
- OBD-II client:
- modes 01, 02, 03, 04, 07, 09 and 0A
- 11-bit and 29-bit addressing, and multi-ECU responses
- PID polling
- auto-detection that listens before it transmits
- UDS client: session control, read/write DID, DTCs, security access, tester present, and "response pending" handling.
- State-changing services need
allowWrites: true. ObdEcuSimulatorfor tests and demos.
dbc #
- DBC parser with line and column errors, and warnings for tolerated input.
- Signal decode and encode:
- Intel and Motorola byte order
- signed, float and double values
- value tables and multiplexing