Antonino Ingargiola wrote:
Nope. In python I use the flushInput() method of the serial object
defined by the pyserial library[0]. The method does just this system
call:
termios.tcflush(self.fd, TERMIOS.TCIFLUSH)
that I think is correct.
There is intermediate buffering between the driver and
the line discipline called the tty flip buffer.
receive data flow:
driver --> tty flip --> line discipline --> application
When you flush input, the line disciplines flush_buffer() method
is called to clear any data residing the in the line discipline.
This does not affect the tty flip buffer
or hardware receive FIFOs.
I suspect the biggest problem is the data in the
tty flip buffer.
A new function to flush the tty flip buffer needs to
be added and then called from tty_io.c:tty_ldisc_flush().
Then a call to tcflush(TCIFLUSH) will clear both buffers.
This still would not clear any data in the hardware
receive FIFOs.
--
Paul Fulghum
Microgate Systems, Ltd.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]