USING LINUX WITH EV3 DEVICES
58
MultiConnect
®
PCIe MTPCIE-EV3 Developer Guide
{
/* Error Management Routine */
} else {
/* ttyUSBx 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-EV3
Page 1: ...MultiConnect PCIe MTPCIE EV3 Developer Guide ...
Page 15: ...DEVELOPER BOARD MultiConnect PCIe MTPCIE EV3 Developer Guide 15 ...
Page 17: ...ASSEMBLY DIAGRAM MultiConnect PCIe MTPCIE EV3 Developer Guide 17 Bottom ...
Page 20: ...DEVELOPER BOARD SCHEMATICS 20 MultiConnect PCIe MTPCIE EV3 Developer Guide ...
Page 21: ...DEVELOPER BOARD SCHEMATICS MultiConnect PCIe MTPCIE EV3 Developer Guide 21 ...
Page 22: ...DEVELOPER BOARD SCHEMATICS 22 MultiConnect PCIe MTPCIE EV3 Developer Guide ...
Page 23: ...DEVELOPER BOARD SCHEMATICS MultiConnect PCIe MTPCIE EV3 Developer Guide 23 ...
Page 24: ...DEVELOPER BOARD SCHEMATICS 24 MultiConnect PCIe MTPCIE EV3 Developer Guide ...
Page 25: ...DEVELOPER BOARD SCHEMATICS MultiConnect PCIe MTPCIE EV3 Developer Guide 25 ...
Page 26: ...DEVELOPER BOARD SCHEMATICS 26 MultiConnect PCIe MTPCIE EV3 Developer Guide ...
Page 27: ...DEVELOPER BOARD SCHEMATICS MultiConnect PCIe MTPCIE EV3 Developer Guide 27 ...