Lely core libraries 2.3.4
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
27enum {
29 IO_PURGE_RX = 1 << 0,
31 IO_PURGE_TX = 1 << 1
32};
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
48io_handle_t io_open_serial(const char *path, io_attr_t *attr);
49
62int io_purge(io_handle_t handle, int flags);
63
74
83int 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:242
io_handle_t io_open_serial(const char *path, io_attr_t *attr)
Opens a serial I/O device.
Definition: serial.c:51
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:197
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:216
An I/O device handle.
Definition: handle.h:33
An opaque serial I/O device attributes type.
Definition: attr.h:34