CAN (Controller Area Network) is an efficient and reliable communication protocol used for real-time control and data exchange. It was originally developed by the German company BOSCH and has now become the international standard ISO 11898. The CAN bus adopts a multi-master competitive bus structure, supports multiple nodes to send and receive data at the same time, and has error detection and automatic retransmission functions, which can effectively improve the reliability and real-time performance of the system. CAN is widely used in automobiles, industrial automation, robots and other fields, and is an indispensable part of modern electronic systems.
##Usage of can
ifconfig -a
# Close CAN
ip link set can0 down
# Set the arbitration segment to 1M baud rate and the data segment to 3M baud rate:
ip link set can0 type can bitrate 1000000 dbitrate 3000000 fd on
#Print can0 information:
ip -details link show can0
# Start CAN:
ip link set can0 up
# Send (standard frame, data frame, ID: 123, date: DEADBEEF)
cansend can0 123##1DEADBEEF
# Send (extended frame, data frame, ID: 00000123, date: DEADBEEF)
cansend can0 00000123##1DEADBEEF
candump can0