查询 can0
ip -details link show can0
关闭can0 网络
ip link set can0 down
出现太多的错误 设备可能计入总线关闭状态,给canrestart-ms 设置一个非零值,可以开启总线关闭自动恢复功能
ip link set CanX type can restart-ms 100
-e 表示扩展帧,CAN_ID最大29bit,标准帧CAN_ID最大11bit
-i表示CAN_ID
cansend can0 -i 0x800 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88 -e
–loop 表示发送20个包
cansend can0 -i 0x02 0x11 0x12 --loop=20