clearing serial port

mixo mixo at beth.uniforum.org.za
Wed Jan 30 07:10:33 EST 2002


Grant Edwards wrote:


> You need to flush the input buffer in the serial port device
> driver. Under Unix, it's done with the tcflush() system call
> or the corresponding ioctl() call.
> 
> 


Here is what  I do
+++++++++++++++++++++++++++++++++++++++++++
termios.tcflush (self.fd, TCIFLUSH)
termios.tcsendbreak (self.fd,1)
buffer = os.read (self.fd,nchars)
+++++++++++++++++++++++++++++++++++++++++++

The problem I get from this, is that I don't always get
data if I flush the input buffer. In fact, when I do get data,
it is usually incomplete.




More information about the Python-list mailing list