REPOST: Re: values of sys.platform? for a serial port lib

Chris Liechti cliechti at gmx.net
Sun Dec 30 13:33:22 CET 2001


Peter Hansen <peter at engcorp.com> wrote in
news:3C2E82A5.D4E1EEB3 at engcorp.com: 
> Chris Liechti wrote:
>> i also have an optional argument to specify the port string, but when
>> this is used it isn't portable anymore. 
> 
> Just a thought, but could you make this the same argument as 
> the port number, allowing either an integer or a string?  
> I could also see a benefit, in a cross-platform serial-port app, 
> in having a method to return the actual device name in use, for 
> display/troubleshooting purposes, even if specified as a number.

minutes after i wrote the that message, i changed the code so that it is 
the same argument that takes a number or a string.

i'll add a method to return the device name.

> You may know this already, but in Windows you need to use 
> "overlapped" I/O operations if you want to be able to have
> a read thread and a write thread waiting independently on 
> operations on the same serial port.  Without this, any time 
> one thread is blocked waiting for results for its operation, 
> the other thread will also block when it tries to access the 
> device even if its operation would not otherwise block.  
> (Or something like that... I don't know the full details 
> behind it, only what I learned trying to implement a win32file-
> based serial port class which didn't have this limitation.)
 
it uses overlapped io. it's roughly based on the serial example that comes 
with the win32all package.

chris


-- 
Chris <cliechti at gmx.net>

========= WAS CANCELLED BY =======:
Path: news.sol.net!spool0-nwblwi.newsops.execpc.com!newsfeeds.sol.net!news-out.visi.com!hermes.visi.com!news.maxwell.syr.edu!feeder.kornet.net!news1.kornet.net!ua4canc3ll3r
From: Chris Liechti <cliechti at gmx.net>
Newsgroups: comp.lang.python
Subject: cmsg cancel <Xns91878A529880Fcliechtigmxnet at 62.2.16.82>
Control: cancel <Xns91878A529880Fcliechtigmxnet at 62.2.16.82>
Date: Mon, 31 Dec 2001 04:08:23 GMT
Organization: A poorly-installed InterNetNews site
Lines: 2
Message-ID: <cancel.Xns91878A529880Fcliechtigmxnet at 62.2.16.82>
NNTP-Posting-Host: 211.57.49.2
X-Trace: news2.kornet.net 1009774258 27193 211.57.49.2 (31 Dec 2001 04:50:58 GMT)
X-Complaints-To: usenet at news2.kornet.net
NNTP-Posting-Date: Mon, 31 Dec 2001 04:50:58 +0000 (UTC)
X-No-Archive: yes
X-Unac4ncel: yes
X-Commentary: I love NewsAgent 1.10 and the Sandblaster Cancel Engine Build 74 (19 March 1999)

This message was cancelled from within Mozilla.



More information about the Python-list mailing list