CAN bus: Difference between revisions
| Line 114: | Line 114: | ||
** CAN_RAW_RECV_OWN_MSGS: if CAN_RAW_LOOPBACK is used, control whether transmitter sees their own frames (default: disabled) | ** CAN_RAW_RECV_OWN_MSGS: if CAN_RAW_LOOPBACK is used, control whether transmitter sees their own frames (default: disabled) | ||
** CAN_RAW_FD_FRAMES: control RX/TX of CAN FD frames (and CANFD_MTU) | ** CAN_RAW_FD_FRAMES: control RX/TX of CAN FD frames (and CANFD_MTU) | ||
** Receives and sends <tt>struct can_frame</tt> | |||
*** Determine whether a device is capable of CAN FD by checking its advertised MTU | *** Determine whether a device is capable of CAN FD by checking its advertised MTU | ||
* SOCK_DGRAM/CAN_BCM: Broadcast Manager mode, used for cyclic transmissions typical of sensor ECUs | * SOCK_DGRAM/CAN_BCM: Broadcast Manager mode, used for cyclic transmissions typical of sensor ECUs | ||
** Also simple timer-based interface for cyclic RX with failure notification | ** Also simple timer-based interface for cyclic RX with failure notification | ||
===can-utils=== | |||
The [https://github.com/linux-can/can-utils can-utils] suite implements basic programs atop SocketCAN: | |||
* candump: log frames to file | |||
* canplayer: replay logged frames to CAN interface | |||
* cansniffer: show IDs and changing data in real time (limited to 11-bit IDs) | |||
* cansend: transmit a CAN frame | |||
The tools above all have ISO-TP variants in the [https://github.com/hartkopp/can-isotp can-isotp] project, replacing "can" with "isotp". | |||
===iproute=== | ===iproute=== | ||
SocketCAN devices, including virtual interfaces (<tt>vcanX</tt>), are configured with the standard <tt>iproute</tt> tool. | SocketCAN devices, including virtual interfaces (<tt>vcanX</tt>), are configured with the standard <tt>iproute</tt> tool. | ||