can_usb 0.1.3
can_usb: ^0.1.3 copied to clipboard
A Flutter package for USB-CANFD communication over serial (UART/USB-CDC), with a frame builder/parser and a high-level CanusbDevice API.
0.1.3 #
- feat(CMD_CAN_START): add configurable FDCAN bitrate selection to
canStart(). The command now sends two additional payload bytes — arbitration-phase index (Payload[1]) and data-phase index (Payload[2]) — matching the updatedCMD_CAN_START(0x01) spec in FRAME_SPECIFICATION.md. - feat: add
ArbBitrateandDataBitrateenums (lib/src/models/bitrate.dart) with one value per supported firmware bitrate setting. CanusbDevice.canStart()now accepts optionalarbBitrateanddataBitratenamed parameters; defaults toArbBitrate.rate1000k/DataBitrate.rate2000k.- Export the new
bitrate.dartmodel from the package entry point.
0.1.2 #
- feat(Android): add
AndroidSerialTransport— newISerialTransportimplementation for Android using the USB Host API (usb_serialpackage).CanusbDevicenow auto-selectsAndroidSerialTransporton Android andSerialPortTransporton all other platforms. - fix(
SerialPortTransport): null_portinonErrorsoisConnectedreturnsfalseimmediately on physical USB removal (Windows). - fix(
SerialPortTransport): explicitly close the OS serial handle inonErrorso Windows releases the COM port and allows re-open after the device is plugged back in.
0.1.1 #
- Metadata fix: shortened
pubspec.yamldescription to comply with pub.flutter-io.cn 60–180 character limit (no functional changes).
0.1.0 #
- Initial release.
- Serial transport layer via
flutter_libserialport(SerialPortTransport). - Injectable
ISerialTransportinterface for easy unit-test mocking. - Binary frame builder (
buildFrame) and streaming frame parser (FrameParser). - CRC/checksum implementation matching the device frame specification.
- Commands: Get Device ID, CAN Start, CAN Stop, Send Downstream (TX), Send Upstream (RX), Protocol Status, Get/Reset CAN Stats, Enter DFU.
- High-level
CanusbDeviceAPI with broadcast streams for received frames, protocol status notifications, and CAN stats notifications. - Typed exception hierarchy:
CanConnectionException,CanTimeoutException,CanChecksumException,CanProtocolException.