PcanCanTransport class

Implemented types

Constructors

PcanCanTransport({required int channel, required int baudrate, Duration pollInterval = const Duration(milliseconds: 1), String? libraryPath, bool enableFd = false, String? bitrateFd})

Properties

baudrate int
Bit-rate timing register pair (e.g. PcanBaud.baud500K). Used by CAN_Initialize for classic CAN.
final
bitrateFd String?
FD bit-rate string (PEAK format, e.g. "f_clock_mhz=80,nom_brp=10,nom_tseg1=12,nom_tseg2=3,nom_sjw=1, data_brp=4,data_tseg1=7,data_tseg2=2,data_sjw=1"). Required when enableFd is true.
final
channel int
Channel handle, e.g. PcanHandle.usbBus1.
final
enableFd bool
Enable CAN-FD. When true the transport calls CAN_InitializeFD with bitrateFd and uses CAN_ReadFD / CAN_WriteFD.
final
hashCode int
The hash code for this object.
no setterinherited
incoming Stream<CanFrame>
Stream of received frames. Broadcast so multiple subscribers can consume the same bus traffic.
no setteroverride
libraryPath String?
Override the shared library path. Use for CI / dev where the PEAK driver was installed to a non-default location.
final
pollInterval Duration
Receive polling cadence. Lower = faster RX, higher = lower CPU. Default 1ms is appropriate for most industrial bus rates.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future<void>
Close the transport.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open() Future<void>
Open the transport (idempotent).
override
send(CanFrame frame) Future<void>
Transmit a frame. Completes when the frame is handed off to the bus.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited