ARCHITECTURE
open()
E355/E265 USER AND BEST PRACTICES GUIDE 19
open()
This claims ownership of the device. Calling this function also flushes all data and
clears all error conditions in the communication channel. The device names that
can be opened for ports are:
"/DEV/COM1A"
"/DEV/COM1B"
"/DEV/COM1C"
"/DEV/COM1D"
"/DEV/COM1E"
Use get_port_status() to get the status of the smart device connection. A
smart device cannot open a communication port until the e355 application has
opened the corresponding device.
Prototype Int open(const char *devname, int attributes);
Parameters
Return Values Positive integer device handle if successful, or -1 with errno set to an error code
if error occurs.
close()
This releases ownership of the device. Calling this function also flushes all data
and clears all error conditions in the communication port.
Prototype int close(int device_handle) parameters:
Parameters
Return Values Returns 0 for success, -1 with errno set to EBADF if device not open.
devname Pointer to the null terminated device name string.
attributes Ignored in this driver.
device_handle The handle returned for the device by the open() call.