Advantech RSB-4210 Evaluation Kit Manual de usuario Pagina 79

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 104
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 78
71 RSB-4210 User Manual
Chapter 3 Software Functionality
close(fd);
printf("test exit\n");
return 0;
}
(More detail please reference "source/linux-2.6.35.3/Documentation/serial/tty.txt")
3.11.4 CAN bus
CAN bus 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).
Typical CAN communication layers. With SocketCAN (left) or conventional (right).
Traditional CAN drivers for Linux are based on the model of character devices. Typi-
cally 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 net-
works in parallel.
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...
The following is a simple (incomplete) example, that sends a packet, then reads back
a packet using the raw interface. It is based on the notes documented in the Linux
Kernel.
#include <can_config.h>
#include <getopt.h>
#include <li/jointfilesconvert/402216/bgen.h>
Vista de pagina 78
1 2 ... 74 75 76 77 78 79 80 81 82 83 84 ... 103 104

Comentarios a estos manuales

Sin comentarios