CANtact CAN Interface#
Interface for CANtact devices from Linklayer Labs
- class can.interfaces.cantact.CantactBus(channel, bitrate=500000, poll_interval=0.01, monitor=False, timing=None, **kwargs)#
channel (int) – Channel number (zero indexed, labeled on multi-channel devices)
bitrate (int) – Bitrate in bits/s
monitor (bool) – If true, operate in listen-only monitoring mode
timing (BitTiming | BitTimingFd | None) – Optional
BitTiminginstance to use for custom bit timing setting. If this argument is set then it overrides the bitrate argument. The f_clock value of the timing instance must be set to 24_000_000 (24MHz) for standard CAN. CAN FD and the
BitTimingFdclass are not supported.
poll_interval (float) –
kwargs (Any) –
- send(msg, timeout=None)#
Transmit a message to the CAN bus.
Override this method to enable the transmit path.
msg (Message) – A message object.
timeout – If > 0, wait up to this many seconds for message to be ACK’ed or for transmit queue to be ready depending on driver implementation. If timeout is exceeded, an exception will be raised. Might not be supported by all interfaces. None blocks indefinitely.
CanOperationError – If an error occurred while sending
Called to carry out any interface specific cleanup required in shutting down a bus.