本页为
CAN介绍
$ ifconfig -a
can0: flags=128<NOARP> mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 71
......
# 关闭CAN:
$ ip link set can0 down
# 设置比特率500KHz:
$ ip link set can0 type can bitrate 500000
# 打印can0信息:
$ ip -details -statistics link show can0
# 启动CAN:
$ ip link set can0 up
# 发送 标准帧,数据帧
$ cansend can0 123#DEADBEEF
# 发送 标准帧,远程帧
$ cansend can0 123#R
# 发送 扩展帧,数据帧
$ cansend can0 00000123#12345678
# 发送 扩展帧,远程帧
$ cansend can0 00000123#R
$ candump can0
具体以读者使用的模块为准

$ candump can0

2. PC端发送

# 发送 标准帧,数据帧
$ cansend can0 123#DEADBEEF
# 发送 标准帧,远程帧 (演示模块不支持远程帧,这里不做演示)
$ cansend can0 123#R
# 发送 扩展帧,数据帧
$ cansend can0 00000123#12345678
# 发送 扩展帧,远程帧
$ cansend can0 00000123#R

2. PC端接收
