Skip to main content
FW version: Stable

CAN Bus Link Layer

This guide explains the link layer for CAN frames used by the YOS communication system. The link layer defines the device addressing and sevice identification. The construct can be used for the utility driver and common I/O API communication.

CAN ID

The CAN ID is composed of:

  • n first bits for the Sender address
  • remaining bits for to SID (Service ID)

The default allocation for the sender address is three bits.

BitDescription
0Sender address bit 0
1Sender address bit 1
2Sender address bit 2
3SID bit 0
4SID bit 1
5SID bit 2
...
Last bit 10 or 28Standard or extended CAN
note

Three address bits limit the CAN bus to 8 devices maximum. This limitation can be modified through:

  • OEM firmware customization
  • Configuring the CAN link layer decoding with msgconf 3 4 0 n
    • Where n specifies bit count for sender address (see yOS documentation)
info

If you do not follow the link layer structure, use the sender address with all bits set to one (e.g. 0b111 for n=3).

CAN ID Example

To send a message with SID 24 from address 7: CAN ID = (24 << 3) + 7 = 192 + 7 = 199 (DEC) = 0xC7 (HEX)

CAN Message Data for Unicast datagram

Unicast messages contain the receiver address in the first byte of the frame, before payload starts:

ByteDescription
0Receiver address
1Payload byte 0
2Payload byte 1
3Payload byte 2
4Payload byte 3
5Payload byte 4
6Payload byte 5
7Payload byte 6

CAN Message Data for Multicast datagram

Multicast messages include only sender address

ByteDescription
0Payload byte 0
1Payload byte 1
2Payload byte 2
3Payload byte 3
4Payload byte 4
5Payload byte 5
6Payload byte 6
7Payload byte 7