首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

CAN 接口测试[通俗易懂]

1.sudo modprobe vcan 加载虚拟can模块 2.sudo ip link add dev vcan0 type vcan 添加vcan0网卡 3.ifconfig -a 可以查到当前can网络 can0 can1,包括收发包数量、是否有错误等等 4.ip link set can0 up type can bitrate 800000 //ip link set can0 type can –help 设置can0的波特率为800kbps,CAN网络波特率最大值为1Mbps 5.ip link set can0 up type can bitrate 800000 loopback on 设置回环模式,自发自收,用于测试是硬件是否正常,loopback不一定支持 6. ip link set can0 down 关闭can0 网络 7.cansend can0 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88 发送默认ID为0x1的can标准帧,数据为0x11 22 33 44 55 66 77 88 每次最大8个byte 8.cansend can0 -i 0x800 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88 -e -e 表示扩展帧,CAN_ID最大29bit,标准帧CAN_ID最大11bit -i表示CAN_ID 9. cansend can0 -i 0x02 0x11 0x12 –loop=20 –loop 表示发送20个包 10.candump can0 接收CAN0数据

03

Linux中查看系统CPU、内存、磁盘、网卡、硬件槽信息的命令

linux查看系统的硬件信息,并不像windows那么直观,这里我罗列了查看系统信息的实用命令,并做了分类,实例解说。 查看系统信息 uname -a 显示系统名、节点名称、操作系统的发行版号、操作系统版本、运行系统的机器 ID 号 cpu lscpu命令,查看的是cpu的统计信息. blue@blue-pc:~$ lscpu Architecture:          i686            #cpu架构 CPU op-mode(s):        32-bit, 64-bit Byte Order:            Little Endian   #小尾序 CPU(s):                4               #总共有4核 On-line CPU(s) list:   0-3 Thread(s) per core:    1               #每个cpu核,只能支持一个线程,即不支持超线程 Core(s) per socket:    4               #每个cpu,有4个核 Socket(s):             1               #总共有1一个cpu Vendor ID:             GenuineIntel    #cpu产商 intel CPU family:            6 Model:                 42 Stepping:              7 CPU MHz:               1600.000 BogoMIPS:              5986.12 Virtualization:        VT-x            #支持cpu虚拟化技术 L1d cache:             32K L1i cache:             32K L2 cache:              256K L3 cache:              6144K 查看/proc/cpuinfo,可以知道每个cpu信息,如每个CPU的型号,主频等。 #cat /proc/cpuinfo processor    : 0 vendor_id    : GenuineIntel cpu family    : 6 model        : 42 model name    : Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz ..... 上面输出的是第一个cpu部分信息,还有3个cpu信息省略了。 内存 概要查看内存情况 free -m              total       used       free     shared    buffers     cached Mem:          3926       3651        274          0         12        404 -/+ buffers/cache:       3235        691 Swap:         9536         31       9505 这里的单位是MB,总共的内存是3926MB。 查看内存详细使用 # cat /proc/meminfo MemTotal:        4020868 kB MemFree:          230884 kB Buffers:            7600 kB Cached:           454772 kB SwapCached:          836 kB ..... 查看内存硬件信息 dmidecode -t memory # dmidecode 2.11 SMBIOS 2.7 present. Handle 0x0008, DMI type 16, 23 bytes Physical Memory Array     Location: System Board Or Motherboard ....     Maximum Capacity: 32 GB .... Handle 0x000A, DMI type 17, 34 bytes .... Memory Device     Array Handle: 0x0008     Error Information Handle: Not Provided     Total Width: 64 bits     Data Width: 64 bits     Size: 4096 MB ..... 磁盘 查看硬

03
领券