Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Aborting a read with pySerial

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


nagle at animats

Nov 6, 2009, 9:27 PM

Post #1 of 2 (47 views)
Permalink
Aborting a read with pySerial

I'm using pySerial to read from a serial port.
One thread reads from the port, with no timeout.
Another thread handles output and other tasks. This works
fine until I want to shut down the program. I can't reliably
break the program out of the read when it's waiting. On Windows,
closing the serial port will abort the read, but that seems to have no
effect on Linux.

I know, I could put a timeout on the read and handle all those
null returns. Is there a better way?

John Nagle
--
http://mail.python.org/mailman/listinfo/python-list


aahz at pythoncraft

Nov 11, 2009, 5:03 PM

Post #2 of 2 (24 views)
Permalink
Re: Aborting a read with pySerial [In reply to]

In article <4af50316$0$1610$742ec2ed[at]news.sonic.net>,
John Nagle <nagle[at]animats.com> wrote:
>
>I'm using pySerial to read from a serial port. One thread reads from
>the port, with no timeout. Another thread handles output and other
>tasks. This works fine until I want to shut down the program. I can't
>reliably break the program out of the read when it's waiting. On
>Windows, closing the serial port will abort the read, but that seems to
>have no effect on Linux.
>
>I know, I could put a timeout on the read and handle all those null
>returns. Is there a better way?

No
--
Aahz (aahz[at]pythoncraft.com) <*> http://www.pythoncraft.com/

[on old computer technologies and programmers] "Fancy tail fins on a
brand new '59 Cadillac didn't mean throwing out a whole generation of
mechanics who started with model As." --Andrew Dalke
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.