Is it possible to use python to get True Full Duplex on a Serial port?

Hendrik van Rooyen hendrik at microcorp.co.za
Sat Aug 15 04:32:17 EDT 2009


On Friday 14 August 2009 16:28:26 Grant Edwards wrote:
> On 2009-08-14, greg <greg at cosc.canterbury.ac.nz> wrote:
> > Hendrik van Rooyen wrote:
8<---------------------------------------------------------------

> Doh!  It didn't even occur to me that somebody would use python
> "file" objects for serial ports, and I completely overlooked
> the fact that the OP was doing that.
>
> In short: don't do that -- it just messes things up

*grin*

All right that makes me feel better - you were so adamant that there is no 
problem that I was starting to doubt my sanity. - So I hereby cancel the 
promise I have just made to put an example together. - It is no longer 
needed.

>
> Do not use Python file objects.  Use the underlying file
> descriptors: os.open(), os.read(), os.write().  That will
> almost certainly solve your problems.
>
> If you want examples of os.xxxxx() usage, below is the
> PosixSerial.py module that I use for Linux-only applications.
> For cross-platform work, use pyserial (whose Posix support is
> based on the code below).
>

8<  ---------------------------------PosixSerial.py----------------------------

Thanks that looks, on first inspection, similar to the serialposix.py module 
in the stdlib, but less cluttered.

- Hendrik



More information about the Python-list mailing list