Checking for data on a serial port
Jay Freeman
jayfreeman at earthlink.net
Tue Mar 28 14:47:42 EST 2000
More information about the Python-list mailing list
Tue Mar 28 14:47:42 EST 2000
- Previous message (by thread): Testing if a file is opened by another program?
- Next message (by thread): Checking for data on a serial port
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Howdy, I'm probably missing something obvious in the docs, but I'd like to have a way to see if there is any data waiting to be read on a serial port. I'm doing a touch screen driven app on RedHat 6.1. I've tried two methods of reading the serial port and they both behave the same way. I've just opened /dev/ttyS0 for read, and used readline(), and I've redirected stdin and used raw_input(). Both methods just sit on that statement and wait until some data comes in. What I'd like to do is check and see if there is any data, if there is then read it, if not then check the time against a default timeout value so I can kill some intermediate screen that the user has walked away from and start the session over (it's a kiosk). Neither termios or tty modules seem to be able to do what I want (although termios is handy for flushing extra touches out of the buffer). Any ideas? Thanks, Jay
- Previous message (by thread): Testing if a file is opened by another program?
- Next message (by thread): Checking for data on a serial port
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list