显示页面修订记录反向链接回到顶部 本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。 CAN总线设备接口 CAN总线的设备驱动接口提供一个通用的接口来建立,设置和监控CAN网络设备。用户可以配置CAN设备,如同配置网络接口一样来通过iproute2工具包设置波特率等。 **设置波特率** 在开始使用CAN网络设备之前,你必须先配置波特率,例: <code> ip link set canX up type can bitrate 125000 </code> X是您要配置的CAN接口序号 启用和停用CAN网络设备 和其它类型的网络类似,您可以用ifconfig命令来启用或停用CAN接口 启用: <code> ifconfig canX up </code> 停用: <code> ifconfig canX down </code> 更多信息请参考Linux内核文档:Documentation/networking/can.txt. **CAN设备测试程序** The CAN support is based on the SocketCAN stack. For more information and source code about this project, refer to http://elinux.org/CAN_Bus and https://github.com/linux-can/. Build the package dey-examples-can in your Yocto project to install the test application can_test. To display the application syntax run: can_test --help * Examples To send an 8-bit CAN message to node can0 with ID 0x12 and the data pattern 0x65: <code> can_test -l 1 -b 8 -d can0 -i 0x12 -p 0x65 -m </code> To receive a similar message: <code> can_test -l 1 -b 8 -d can0 -i 0x12 -p 0x65 </code>