Serial port Input/Output conflicts

Chris Liechti cliechti at gmx.net
Thu Feb 7 16:33:32 EST 2002


[posted and mailed]

jwk at mrao.cam.ac.uk (James Keen) wrote in 
news:ef77152a.0202070729.3a6a5d2a at posting.google.com:
...
> The status data gets sent to the port from my Hardware, which I can
> read, but the serial port refuses to send any more commands to my
> hardware until I close and then reopen the port.
> 
> serial = os.open('/dev/ttyS1', FCNTL.O_RDWR|os.O_NDELAY,0)

not much of an initialization... your port could be in processing mode 
where it interprets control characters, flow controls etc...
this initialization is not likely to work with binary data.

http://sourceforge.net/project/showfiles.php?group_id=42303
&release_id=67594

(the url above should be one line, here's the project page: 
http://mspgcc.sourceforge.net/) download pybsl, extract serial* and 
use the serial.Serial class. i have trimmed it to work with binary 
data.

...
>    global serial

codesidered writing a class that represents you hardware? would be 
cleaner that juggling around globals.

chris

-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list