USING LINUX WITH EV3 DEVICES
MultiConnect
®
PCIe MTPCIE-EV3 Developer Guide
59
Parameters:
fildes – file descriptor
buf – destination buffer pointer
nbyte – number of bytes that write() attempts to write
Returns
:
The number of bytes actually written if the operation is completed successfully, otherwise it is -1.
Example
Write
strlen(value_to_be_written)
bytes from the buffer pointed by
value_to_be_written
to the file
associated with the open file descriptor,
fd
.
char value_to_be_written[] = “dummy_write”;
if (write(fd, value_to_be_written, strlen(value_to_be_written)) < 0)
{
/* Error Management Routine */
} else {
/* Value Written */
}
close()
The
close()
function shall deallocate the file descriptor indicated by
fildes
. To deallocate means to make the file
descriptor available for return by subsequent calls to
open()
or other functions that allocate file descriptors.
Header File
unistd.h
Prototype:
int close(int fildes);
Parameters:
fildes - file descriptor
Returns
:
0 if successful, otherwise it is -1.
Example
Close the ttyUSBx file.
if(close(fd) < 0)
{
/* Error Management Routine */
} else {
/* File Closed */
}
Содержание MultiConnect MTPCIE-EV3
Страница 1: ...MultiConnect PCIe MTPCIE EV3 Developer Guide ...
Страница 15: ...DEVELOPER BOARD MultiConnect PCIe MTPCIE EV3 Developer Guide 15 ...
Страница 16: ...ASSEMBLY DIAGRAM 16 MultiConnect PCIe MTPCIE EV3 Developer Guide Chapter 5 Assembly Diagram Top ...
Страница 17: ...ASSEMBLY DIAGRAM MultiConnect PCIe MTPCIE EV3 Developer Guide 17 Bottom ...
Страница 20: ...DEVELOPER BOARD SCHEMATICS 20 MultiConnect PCIe MTPCIE EV3 Developer Guide ...
Страница 21: ...DEVELOPER BOARD SCHEMATICS MultiConnect PCIe MTPCIE EV3 Developer Guide 21 ...
Страница 22: ...DEVELOPER BOARD SCHEMATICS 22 MultiConnect PCIe MTPCIE EV3 Developer Guide ...
Страница 23: ...DEVELOPER BOARD SCHEMATICS MultiConnect PCIe MTPCIE EV3 Developer Guide 23 ...
Страница 24: ...DEVELOPER BOARD SCHEMATICS 24 MultiConnect PCIe MTPCIE EV3 Developer Guide ...
Страница 25: ...DEVELOPER BOARD SCHEMATICS MultiConnect PCIe MTPCIE EV3 Developer Guide 25 ...
Страница 26: ...DEVELOPER BOARD SCHEMATICS 26 MultiConnect PCIe MTPCIE EV3 Developer Guide ...
Страница 27: ...DEVELOPER BOARD SCHEMATICS MultiConnect PCIe MTPCIE EV3 Developer Guide 27 ...