3 #ifndef SERIAL_IMPL_UNIX_H 4 #define SERIAL_IMPL_UNIX_H 23 static timespec timespec_now();
30 unsigned long baudrate,
46 bool waitReadable(uint32_t timeout);
48 void waitByteTimes(
size_t count);
50 int waitfordata(
size_t data_count, uint32_t timeout,
size_t *returned_size);
52 size_t read(uint8_t *buf,
size_t size = 1);
54 size_t write(
const uint8_t *data,
size_t length);
63 void sendBreak(
int duration);
65 bool setBreak(
bool level);
67 bool setRTS(
bool level);
69 bool setDTR(
bool level);
81 uint32_t getByteTime();
83 void setPort(
const string &port);
85 string getPort()
const;
87 void setTimeout(
Timeout &timeout);
91 bool setBaudrate(
unsigned long baudrate);
93 bool setStandardBaudRate(speed_t baudrate);
95 bool setCustomBaudRate(
unsigned long baudrate);
97 unsigned long getBaudrate()
const;
115 bool setTermios(
const termios *tio);
117 bool getTermios(termios *tio);
138 unsigned long baudrate_;
139 uint32_t byte_time_ns_;
147 pthread_mutex_t read_mutex;
149 pthread_mutex_t write_mutex;
154 #endif // SERIAL_IMPL_UNIX_H 156 #endif // !defined(_WIN32) Definition: unix_serial.h:17
parity_t
Definition: serial.h:26
bytesize_t
Definition: serial.h:16
stopbits_t
Definition: serial.h:37
Definition: unix_serial.h:27
flowcontrol_t
Definition: serial.h:46