libserialport
0.1.0
cross-platform library for accessing serial ports
|
Functions | |
enum sp_return | sp_new_event_set (struct sp_event_set **result_ptr) |
Allocate storage for a set of events. More... | |
enum sp_return | sp_add_port_events (struct sp_event_set *event_set, const struct sp_port *port, enum sp_event mask) |
Add events to a struct sp_event_set for a given port. More... | |
enum sp_return | sp_wait (struct sp_event_set *event_set, unsigned int timeout) |
Wait for any of a set of events to occur. More... | |
void | sp_free_event_set (struct sp_event_set *event_set) |
Free a structure allocated by sp_new_event_set(). More... | |
enum sp_return sp_add_port_events | ( | struct sp_event_set * | event_set, |
const struct sp_port * | port, | ||
enum sp_event | mask | ||
) |
Add events to a struct sp_event_set for a given port.
The port must first be opened by calling sp_open() using the same port structure.
After the port is closed or the port structure freed, the results may no longer be valid.
event_set | Event set to update. |
port | Pointer to port structure. |
mask | Bitmask of events to be waited for. |
void sp_free_event_set | ( | struct sp_event_set * | event_set | ) |
Free a structure allocated by sp_new_event_set().
enum sp_return sp_new_event_set | ( | struct sp_event_set ** | result_ptr | ) |
Allocate storage for a set of events.
The user should allocate a variable of type struct sp_event_set *, then pass a pointer to this variable to receive the result.
The result should be freed after use by calling sp_free_event_set().
enum sp_return sp_wait | ( | struct sp_event_set * | event_set, |
unsigned int | timeout | ||
) |
Wait for any of a set of events to occur.
event_set | Event set to wait on. |
timeout | Timeout in milliseconds, or zero to wait indefinitely. |