CAN Bus#
About This Module#
The CAN bus module provides access to the CAN bus typically used for communication between different ECUs and devices/sensors in a vehicle. Also part of this module is a CAN data interpreter, supporting communication in DBC format and extendable by the user for additional formats.
CAN bus sensor#
The CAN sensor module is defined in CAN.h. It provides an abstracted interface to send, receive and filter CAN messages. Extended CAN frame
format is supported. CAN FD (Flexible Data-Rate) messages for longer 64 byte messages and data bit rate switching is supported on compatible CAN
Bus devices.
The supported interfaces are:
can.socketinterface for system CAN bus, including system virtual socket CAN. Supports CAN FD messages for message up to 64 bytes and data bit rate switching.can.virtualinterface for reading CAN data from binary logs.can.simulatorinterface similar tocan.socket. This configuration returns messages timestamped against an external source, supported by interleaved CAN messages wth payloads interpreted as timestamps. The timestamp message ID is fixed at0x0F2. For example, if an external application wanted to send a message with ID0xABCwith custom timestamp, it may send:
ID 0x0F2 <timestamp>
ID 0xABC DE AD BE EF
CAN message interpreter#
The CAN interpreter module is defined in Interpreter.h. It supports the DBC communication format and can be extended to additional formats
by the user.