pyserial win32 port numbering

david david at nospam.spam
Mon Aug 13 22:26:31 EDT 2007


http://pyserial.sourceforge.net/

"port numbering starts at zero, no need to
know the port name in the user program"


But the implementation in SerialWin32 is
just
	(Portnum +1)


So there is no 'start' to the port numbering at all:
there is no assurance that you will have a pySerial
serial port Zero, even if you have 57 Windows Serial
ports.


Renumbering the serial ports to start at zero would sort of make sense 
if it was done in a semi-portable way - so you could move from one 
machine with two serial ports to another machine with two serial ports.

In Windows, that requires enumerating the serial ports, and assigning a 
logical pySerial port number to each.

This is going to become more of a problem, because Windows logo 
compliant PC's by definition do not have a serial port 1 or 2 so the 
pySerial logical port numbers are likely to start at 2 or 4.

It's already a problem on PC's that have PCI serial port cards (not ISA 
serial port cards). The pySerial logical port numbering typically goes 
something like 0, 4,5, mapping the Windows serial ports 1,5,6

(david)



More information about the Python-list mailing list