Do not flush the input and output buffers when configuring the device.
This commit is contained in:
parent
40835b8d80
commit
b9a43e3157
@ -277,12 +277,6 @@ serial_configure (serial *device, int baudrate, int databits, int parity, int st
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Flush the input and output buffers.
|
||||
if (tcflush (device->fd, TCIOFLUSH) != 0) {
|
||||
TRACE ("tcflush");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Apply the new settings.
|
||||
if (tcsetattr (device->fd, TCSANOW, &tty) != 0) {
|
||||
TRACE ("tcsetattr");
|
||||
|
||||
@ -246,12 +246,6 @@ serial_configure (serial *device, int baudrate, int databits, int parity, int st
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Flush the input and output buffers.
|
||||
if (!PurgeComm (device->hFile, PURGE_RXABORT | PURGE_RXCLEAR | PURGE_TXABORT | PURGE_TXCLEAR)) {
|
||||
TRACE ("PurgeComm");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Apply the new settings.
|
||||
if (!SetCommState (device->hFile, &dcb)) {
|
||||
TRACE ("SetCommState");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user