Lely core libraries  2.2.5
serial.h
Go to the documentation of this file.
1 
22 #ifndef LELY_IO_SERIAL_H_
23 #define LELY_IO_SERIAL_H_
24 
25 #include <lely/io/io.h>
26 
27 enum {
29  IO_PURGE_RX = 1 << 0,
31  IO_PURGE_TX = 1 << 1
32 };
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
48 io_handle_t io_open_serial(const char *path, io_attr_t *attr);
49 
62 int io_purge(io_handle_t handle, int flags);
63 
73 int io_serial_get_attr(io_handle_t handle, io_attr_t *attr);
74 
83 int io_serial_set_attr(io_handle_t handle, const io_attr_t *attr);
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif // !LELY_IO_SERIAL_H_
This is the public header file of the I/O library.
@ IO_PURGE_TX
Purge the transmit buffer of a serial I/O device.
Definition: serial.h:31
@ IO_PURGE_RX
Purge the receive buffer of a serial I/O device.
Definition: serial.h:29
int io_serial_set_attr(io_handle_t handle, const io_attr_t *attr)
Sets the attributes of a serial I/O device to those in *attr.
Definition: serial.c:238
io_handle_t io_open_serial(const char *path, io_attr_t *attr)
Opens a serial I/O device.
Definition: serial.c:47
int io_purge(io_handle_t handle, int flags)
Purges the receive and/or transmit buffers of a serial I/O device.
Definition: serial.c:193
int io_serial_get_attr(io_handle_t handle, io_attr_t *attr)
Retrieves the current attributes of a serial I/O device and stores them in *attr.
Definition: serial.c:212
An I/O device handle.
Definition: handle.h:41
An opaque serial I/O device attributes type.
Definition: attr.h:34