Go to the source code of this file.
Definition at line 47 of file sio.h.
Opens a serial device for communication.
- Parameters
-
- Returns
- handle to serial device if successful, NULL otherwise
Reads from the serial device.
- Parameters
-
fd | serial device handle |
data | pointer to data buffer for receiving |
len | maximum length (in bytes) of data to receive |
- Returns
- number of bytes actually received - may be 0 if aborted by sio_read_abort
- Note
- This function will block until data can be received. The blocking can be cancelled by calling sio_read_abort().
Receives a single character from the serial device.
- Parameters
-
- Note
- This function will block until a character is received.
Sends a single character to the serial device.
- Parameters
-
c | character to send |
fd | serial device handle |
- Note
- This function will block until the character can be sent.
Tries to read from the serial device. Same as sio_read but returns immediately if no data is available and never blocks.
- Parameters
-
fd | serial device handle |
data | pointer to data buffer for receiving |
len | maximum length (in bytes) of data to receive |
- Returns
- number of bytes actually received
Writes to the serial device.
- Parameters
-
fd | serial device handle |
data | pointer to data to send |
len | length (in bytes) of data to send |
- Returns
- number of bytes actually sent
- Note
- This function will block until all data can be sent.