![Multitech MultiConnect MTPCIE-BW Developer'S Manual Download Page 77](http://html1.mh-extra.com/html/multitech/multiconnect-mtpcie-bw/multiconnect-mtpcie-bw_developers-manual_1855979077.webp)
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)
Summary of Contents for MultiConnect MTPCIE-BW
Page 1: ...MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide...
Page 20: ...DEVELOPER BOARD AND SCHEMATICS 20 MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide...
Page 22: ...DEVELOPER BOARD AND SCHEMATICS 22 MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide Bottom...
Page 25: ...DEVELOPER BOARD AND SCHEMATICS MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide 25...
Page 26: ...DEVELOPER BOARD AND SCHEMATICS 26 MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide...
Page 27: ...DEVELOPER BOARD AND SCHEMATICS MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide 27...
Page 28: ...DEVELOPER BOARD AND SCHEMATICS 28 MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide...
Page 29: ...DEVELOPER BOARD AND SCHEMATICS MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide 29...
Page 30: ...DEVELOPER BOARD AND SCHEMATICS 30 MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide...
Page 31: ...DEVELOPER BOARD AND SCHEMATICS MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide 31...
Page 32: ...DEVELOPER BOARD AND SCHEMATICS 32 MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide...
Page 51: ...MECHANICAL DRAWING MultiConnect PCIe MTPCIE H5 MTPCIE BW Developer Guide 51 MTPCIE BW...