Go Back   Velocity Reviews > Newsgroups > Python
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Python - Aborting a read with pySerial

 
Thread Tools Search this Thread
Old 11-07-2009, 05:27 AM   #1
Default 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


John Nagle
  Reply With Quote
Old 11-12-2009, 01:03 AM   #2
Aahz
 
Posts: n/a
Default Re: Aborting a read with pySerial
In article <4af50316$0$1610$>,
John Nagle <> 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 () <*> 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


Aahz
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46