当前位置: 首页 > news >正文

个人做外包网站多少钱微网站公司

个人做外包网站多少钱,微网站公司,商会网站建设开发,安徽同济建设集团网站最近调试一个sja1000的can驱动#xff0c;发现到了2.6.36#xff0c;linux把can总线封装成了网络接口。内核文档里给出了这么修改的原因。1. Overview / What is Socket CAN--------------------------------The socketcan package is an implementation of CAN protocols (C…最近调试一个sja1000的can驱动发现到了2.6.36linux把can总线封装成了网络接口。内核文档里给出了这么修改的原因。1. Overview / What is Socket CAN--------------------------------The socketcan package is an implementation of CAN protocols (Controller Area Network) for Linux.  CAN is a networking technology which has widespread use in automation, embedded devices, and automotive fields.  While there have been other CAN implementations for Linux based on character devices, Socket CAN uses the Berkeley socket API, the Linux network stack and implements the CAN device drivers as network interfaces.  The CAN socket API has been designed as similar as possible to the TCP/IP protocols to allow programmers, familiar with network programming, to easily learn how to use CAN sockets.2. Motivation / Why using the socket API----------------------------------------There have been CAN implementations for Linux before Socket CAN so the question arises, why we have started another project.  Most existing implementations come as a device driver for some CAN hardware, they are based on character devices and provide comparatively little functionality.  Usually, there is only a hardware-specific device driver which provides a character device interface to send and receive raw CAN frames, directly to/from the controller hardware. Queueing of frames and higher-level transport protocols like ISO-TP have to be implemented in user space applications.  Also, most character-device implementations support only one single process to open the device at a time, similar to a serial interface.  Exchanging the CAN controller requires employment of another device driver and often the need for adaption of large parts of the application to the new drivers API.Socket CAN was designed to overcome all of these limitations.  A new protocol family has been implemented which provides a socket interface to user space applications and which builds upon the Linux network layer, so to use all of the provided queueing functionality.  A device driver for CAN controller hardware registers itself with the Linux network layer as a network device, so that CAN frames from the controller can be passed up to the network layer and on to the CAN protocol family module and also vice-versa.  Also, the protocol family module provides an API for transport protocol modules to register, so that any number of transport protocols can be loaded or unloaded dynamically.  In fact, the can core module alone does not provide any protocol and cannot be used without loading at least one additional protocol module.  Multiple sockets can be opened at the same time, on different or the same protocol module and they can listen/send frames on different or the same CAN IDs.  Several sockets listening on the same interface for frames with the same CAN ID are all passed the same received matching CAN frames.  An application wishing to communicate using a specific transport protocol, e.g. ISO-TP, just selects that protocol when opening the socket, and then can read and write application data byte streams, without having to deal with CAN-IDs, frames, etc.Similar functionality visible from user-space could be provided by a character device, too, but this would lead to a technically inelegant solution for a couple of reasons:* Intricate usage.  Instead of passing a protocol argument to socket(2) and using bind(2) to select a CAN interface and CAN ID, an application would have to do all these operations using ioctl(2)s.* Code duplication.  A character device cannot make use of the Linux network queueing code, so all that code would have to be duplicatedfor CAN networking.* Abstraction.  In most existing character-device implementations, the hardware-specific device driver for a CAN controller directlyprovides the character device for the application to work with.This is at least very unusual in Unix systems for both, char andblock devices.  For example you dont have a character device for a certain UART of a serial interface, a certain sound chip in your computer, a SCSI or IDE controller providing access to your harddisk or tape streamer device.  Instead, you have abstraction layers which provide a unified character or block device interface to the application on the one hand, and a interface for hardware-specific device drivers on the other hand.  These abstractions are providedby subsystems like the tty layer, the audio subsystem or the SCSIand IDE subsystems for the devices mentioned above.The easiest way to implement a CAN device driver is as a character device without such a (complete) abstraction layer, as is done by most existing drivers.  The right way, however, would be to add such alayer with all the functionality like registering for certain CANIDs, supporting several open file descriptors and (de)multiplexingCAN frames between them, (sophisticated) queueing of CAN frames, and providing an API for device drivers to register with.  However, thenit would be no more difficult, or may be even easier, to use the networking framework provided by the Linux kernel, and this is what Socket CAN does.The use of the networking framework of the Linux kernel is just the natural and most appropriate way to implement CAN for Linux.好吧我是干活的最喜欢内核自带的驱动。plx_pci.c是plx905x扩展几个sja1000的驱动。我这里是fpga做的pci-localbus桥扩展2片sja1000。简直是专门为我准备的嘛很快就改吧好了驱动ifocnfig -a 也能看到can节点了。但是如何使用 Socket CAN API真犯愁啊。参照http://archive.cnblogs.com/a/1916143/交叉编译了can-utils 4.0.6的几个重要工具。busybox的文件系统还要移植ip命令。1、首先配置can0ip link set can0 type can tq 125 prop-seg 6  phase-seg1 7 phase-seg2 2 sjw 1这时dmesg可以看到sja1000_fpga_pci 0000:07:04.0: setting BTR00x01 BTR10x1c周立功的usbcan-2a测试模块里波特率250kbs时就是BTR00x01 BTR10x1c2、ip -details link show can0 查看一下can0: mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10link/cancan state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0bitrate 500000 sample-point 0.875tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1sja1000: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1clock 160000003、接收测试接收周立功测试软件发送的帧# ./candump can0interface can0, family 29, type 3, proto 10x00000002 [8] 70 01 02 03 04 05 06 070x00000002 [8] 70 01 02 03 04 05 06 070x00000002 [8] 70 01 02 03 04 05 06 070x00000002 [8] 70 01 02 03 04 05 06 070x00000002 [8] 70 01 02 03 04 05 06 070x00000002 [8] 70 01 02 03 04 05 06 070x00000002 [8] 70 01 02 03 04 05 06 070x00000002 [8] 70 01 02 03 04 05 06 070x00000002 [8] 70 01 02 03 04 05 06 074、发送测试./cansend can0 -e 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88interface can0, family 29, type 3, proto 1周立功测试软件上能看到接收的帧5、重启使用内核文档说的ip link set can0 type can restart-ms 100 会报RTNETLINK answers: Device or resource busy使用ifconfig can0 down ;ip link set can0 up type can即可并没有掌握sja1000波特率的配置。摸索出4种常见波特率250kbpsip link set can0 type can tq 125 prop-seg 6  phase-seg1 7 phase-seg2 2 sjw 1125kbpsip link set can0 type can tq 250 prop-seg 6  phase-seg1 7 phase-seg2 2 sjw 1500kbpsip link set can0 type can tq 75 prop-seg 6  phase-seg1 7 phase-seg2 2 sjw 11000kbpsip link set can0 up type can bitrate 2000000常见用法ip -details link show can0ifconfig can0 down ;ip link set can0 up type can./candump can0./cansend   can0 -e 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
http://www.zqtcl.cn/news/989257/

相关文章:

  • 如何创业做网站设计公司工作室
  • 游戏网站建设多少中国煤炭建设协网站
  • 动态图表网站宁津做网站
  • 黑龙江生产建设兵团各连网站成功网站建设案例
  • 一级a做爰精免费网站肇庆网站制作软件
  • wordpress加分页北京优化生育
  • 乐至建设局网站工程项目管理软件哪个好
  • 太原公司网站建立wordpress插件直播
  • 比较有名的diy制作网站做照片视频的网站
  • 河北石家庄建设网站wordpress nginx apache
  • 上海免费网站建设品牌wordpress主题安装失败下载失败
  • 买公司的网站商城系统开发
  • 网页设计国外设计欣赏网站深夜视频在线免费
  • 做网站怎么租用服务器杭州网站建设hzyze
  • .asp 网站北京最新防疫信息
  • 网站上传用什么软件做视频教程114查询
  • 网站小图标素材网站开发需要提供哪些东西
  • 阿里巴巴国际站买家入口百度建网站多少钱
  • 为网站网站做代理怎么判wordpress 调用当前分类名称
  • 多用户网站管理系统定制网站建设与运营案例
  • 毕业设计做的网站抄袭网站开发执行文档
  • 自己做网站都要什么软件网址你懂我意思正能量不用下载
  • 网站内容的创新wordpress美食主题
  • 程序员做游戏还是做网站好雅安移动网站建设
  • wordpress伪静态大学seo诊断网站免费诊断平台
  • 企业网站模板下载软件商务网站规划与建设心得
  • 做网站的像素是多少钱郑州公司网页
  • 北京游戏网站建设特殊符号网站
  • c 网站开发技术代注册公司要多少钱
  • 设计师参考效果图网站如何写网站建设实验结果分析