翻訳と辞書
Words near each other
・ Socket FP3
・ Socket FS1
・ Socket FT1
・ Socket FT3
・ Socket G1
・ Socket G2
・ Socket G3
・ Socket G3 Memory Extender
・ Socket G34
・ Socket M
・ Socket P
・ Socket preservation
・ Socket S1
・ Socket wrench
・ Socket.IO
SocketCAN
・ Sockets Direct Protocol
・ Sockeye (disambiguation)
・ Sockeye salmon
・ Sockgate
・ Sockington
・ Sockl and Nathan
・ Socko in Morocco
・ Sockpuppet (Internet)
・ SOCKS
・ Socks (cat)
・ Socks (disambiguation)
・ Socks (novel)
・ Socks and Cakes
・ Socks and sandals


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

SocketCAN : ウィキペディア英語版
SocketCAN

SocketCAN is a set of open source CAN drivers and a networking stack contributed by Volkswagen Research to the Linux kernel. Formerly known as ''Low Level CAN Framework'' (LLCF).
Traditional CAN drivers for Linux are based on the model of character devices. Typically they only allow sending to and receiving from the CAN controller. Conventional implementations of this class of device driver only allow a single process to access the device, which means that all other processes are blocked in the meantime. In addition, these drivers typically all differ slightly in the interface presented to the application, stifling portability. The SocketCAN concept on the other hand uses the model of network devices, which allows multiple applications to access one CAN device simultaneously. Also, a single application is able to access multiple CAN networks in parallel.
The SocketCAN concept extends the Berkeley sockets API in Linux by introducing a new protocol family, PF_CAN, that coexists with other protocol families like PF_INET for the Internet Protocol. The communication with the CAN bus is therefore done analogously to the use of the Internet Protocol via sockets. Fundamental components of SocketCAN are the network device drivers for different CAN controllers and the implementation of the CAN protocol family. The protocol family, PF_CAN, provides the structures to enable different protocols on the bus: Raw sockets for direct CAN communication and transport protocols for point-to-point connections. Moreover the broadcast manager which is part of the CAN protocol family provides functions e.g. for sending CAN messages periodically or realize complex message filters.
Patches about CAN were added in the 2.6.25 Linux kernel. Meanwhile some controller drivers were added and work is going on to add drivers for a variety of controllers.
== Usage ==

The application first sets up its access to the CAN interface by initialising a socket (much like in TCP/IP communications), then binding that socket to an interface (or all interfaces, if the application so desires). Once bound, the socket can then be used like a UDP socket via read, write, etc...
Python added support for SocketCAN in version 3.3.〔http://bugs.python.org/issue10141〕 An open source library (python-can ) provides SocketCAN support for Python 2.
There is also a virtual can driver for testing purposes which can be loaded and created in Linux with the commands below.
$ modprobe can
$ modprobe can_raw
$ modprobe vcan
$ sudo ip link add dev vcan0 type vcan
$ sudo ip link set up vcan0
$ ip link show vcan0
3: vcan0: mtu 16 qdisc noqueue state UNKNOWN
link/can

The following code snippet is a working example of the SocketCAN API, that sends a packet using the raw interface. It is based on the notes documented in the Linux Kernel.〔Viewable online from (Linux Kernel Documentation ) or in linux/Documentation/networking/can.txt in most recent source trees〕

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
int
main(void)

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「SocketCAN」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.