
USING LINUX WITH H5 DEVICES
MultiConnect
®
PCIe MTPCIE-H5/MTPCIE-BW Developer Guide
77
int fd; // file descriptor for the /dev/ttyACM0 entry
if((fd = open("/dev/ttyACM0", O_RDONLY) < 0)
{
/* Error Management Routine */
} else {
/* ttyACM0 Device Opened */
}
read()
The
read()
function reads
nbyte
bytes from the file associated with the open file descriptor,
fildes
, and copies them
in the buffer that is pointed to by
buf
.
Header File
unistd.h
Prototype:
ssize_t read(int fildes, void *buf, size_t nbyte)
Parameters:
fildes - file descriptor
buf - destination buffer pointer
nbyte - number of bytes that read() attempts to read
Returns
:
The number of bytes actually read if the operation is completed successfully, otherwise it is -1.
Example
Read
sizeof(read_buff)
bytes from the file associated with
fd
and stores them
into
read_buff
.
char read_buff[BUFF_LEN];
if(read(fd, read_buff, sizeof(read_buff)) < 0)
{
/* Error Management Routine */
} else {
/* Value Read */
}
write()
The
write()
function writes
nbyte
bytes from the buffer that are pointed by
buf
to the file associated with the open
file descriptor.
fildes
.
Header File
unistd.h
Prototype:
ssize_t write(int fildes, const void *buf, size_t nbyte)
Содержание MultiConnect MTPCIE-BW
Страница 1: ...MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide...
Страница 20: ...DEVELOPER BOARD AND SCHEMATICS 20 MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide...
Страница 21: ...DEVELOPER BOARD AND SCHEMATICS MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide 21 Assembly Diagram Top...
Страница 22: ...DEVELOPER BOARD AND SCHEMATICS 22 MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide Bottom...
Страница 25: ...DEVELOPER BOARD AND SCHEMATICS MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide 25...
Страница 26: ...DEVELOPER BOARD AND SCHEMATICS 26 MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide...
Страница 27: ...DEVELOPER BOARD AND SCHEMATICS MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide 27...
Страница 28: ...DEVELOPER BOARD AND SCHEMATICS 28 MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide...
Страница 29: ...DEVELOPER BOARD AND SCHEMATICS MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide 29...
Страница 30: ...DEVELOPER BOARD AND SCHEMATICS 30 MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide...
Страница 31: ...DEVELOPER BOARD AND SCHEMATICS MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide 31...
Страница 32: ...DEVELOPER BOARD AND SCHEMATICS 32 MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide...
Страница 51: ...MECHANICAL DRAWING MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide 51 MTPCIE BW...