CAN driver

The CAN driver is a driver for using CAN bus connections.

class jumpstarter_driver_can.client.CanClient(*, uuid: ~uuid.UUID = <factory>, labels: dict[str, str] = <factory>, channel: ~grpc.aio._base_channel.Channel, children: dict[str, DriverClient] = <factory>, portal: BlockingPortal)

A generic CAN client for sending/recieving traffic to/from an exported CAN bus.

property channel_info: str

Get the CAN channel info.

flush_tx_buffer() None

Flush the transmission buffer.

property protocol: CanProtocol

Get the CAN protocol supported by the bus.

send(msg: Message, timeout: float | None = None) None

Send an individual CAN message.

shutdown() None

Shutdown the bus.

property state: BusState

The current state of the CAN bus.

class jumpstarter_driver_can.client.IsoTpClient(*, uuid: ~uuid.UUID = <factory>, labels: dict[str, str] = <factory>, channel: ~grpc.aio._base_channel.Channel, children: dict[str, DriverClient] = <factory>, portal: BlockingPortal)

An ISO-TP CAN client for sending/recieving ISO-TP frames to/from an exported CAN bus.

available() bool

Returns True if an ISO-TP frame is awaiting in the reception queue, False otherwise.

recv(block: bool = False, timeout: float | None = None) bytes | None

Dequeue an ISO-TP frame from the reception queue if available.

send(data: bytes, target_address_type: int | None = None, send_timeout: float | None = None) None

Enqueue an ISO-TP frame to send over the CAN network.

set_address(address: Address | AsymmetricAddress) None

Sets the layer address. Can be set after initialization if needed. May cause a timeout if called while a transmission is active.

start() None

Start listening for messages.

stop() None

Stop listening for messages.

stop_receiving() None

Stop receiving messages.

stop_sending() None

Stop sending messages.

transmitting() bool

Returns True if an ISO-TP frame is being transmitted, False otherwise.