add flush functions for serial helpers

pull/139/head
Robin Müller 2 months ago
parent 227524a21d
commit 341437df13
Signed by: muellerr
GPG Key ID: 11D4952C8CCEF814

@ -161,3 +161,7 @@ void uart::setStopbits(struct termios& options, StopBits bits) {
options.c_cflag &= ~CSTOPB;
}
}
void uart::flushRxBuf(int fd) { tcflush(fd, TCIFLUSH); }
void uart::flushTxRxBuf(int fd) { tcflush(fd, TCIOFLUSH); }

@ -64,6 +64,9 @@ void setParity(struct termios& options, Parity parity);
void ignoreCtrlLines(struct termios& options);
void flushRxBuf(int fd);
void flushTxRxBuf(int fd);
int readCountersAndErrors(int serialPort, serial_icounter_struct& icounter);
} // namespace uart

Loading…
Cancel
Save