can总线配置

CAN

总线配置

Linux

系统中,

CAN

总线接口

备作为网络

系统进行统一

理。在控制

台下

, 

CAN

总线

的配置和以

网的配置使用相

命令

在控制

上输

入命令:

ifconfig –a 

可以得到以下结果:

can0   Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 

        NOARP  MTU:16  Metric:1 

        RX packets:0 errors:0 dropped:0 overruns:0 frame:0 

        TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 

        collisions:0 txqueuelen:10  

        RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)         Interrupt:18  

 eth0   Link encap:Ethernet  HWaddr 00:50:c2:22:3b:0e   

        UP BROADCAST MULTICAST  MTU:1500  Metric:1 

        RX packets:0 errors:0 dropped:0 overruns:0 frame:0 

        TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 

        collisions:0 txqueuelen:1000  

        RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B) 

 eth1   Link encap:Ethernet  HWaddr 00:50:c2:22:3b:60   

        UP BROADCAST MULTICAST  MTU:1500  Metric:1 

        RX packets:0 errors:0 dropped:0 overruns:0 frame:0 

        TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 

        collisions:0 txqueuelen:1000  

        RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B) 

        Interrupt:41 Base address:0xe000   lo     Link encap:Local Loopback   

 inet addr:127.0.0.1  Mask:255.0.0.0  inet6 addr: ::1/128 Scope:Host 

 UP LOOPBACK RUNNING  MTU:16436  Metric:1 

 RX packets:256 errors:0 dropped:0 overruns:0 frame:0 

 TX packets:256 errors:0 dropped:0 overruns:0 carrier:0 

 collisions:0 txqueuelen:0   RX bytes:19952 (19.9 KB)  TX bytes:19952 (19.9 KB) 

 

在上面的

结果

中,

eth0

eth1

备为以

网接口,

can0

备为

CAN

总线接口。接

来使用

ip

来配置

CAN

总线的位速

率:

ip link set can0 type cantq 125 prop-seg 6phase-seg1 7 phase-seg2 2 sjw 1 

可以使用

ip

命令直

定位速

率:

ip link set can0 type can bitrate 125000 

成后,可以通过

面的

命令查询

can0

备的

ip -details link show can0 

成后,可以使用

面的

命令

使能

can0

ifconfig can0 up 

使用

面的

命令取消

can0

备使能

ifconfig can0 down 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值