Sunday, December 13, 2009

Quick Note – Windows Serial Port Enumeration

I am working to develop a serial port application on Windows. As part of this project I ended up wanting to code a routine to present a list of active serial ports on a PC.

What I thought would be an easy tasked turned into an evenings worth of work…

It turns out that there are a number of different ways to pull serial port information from a PC and they don’t all come up with the same set of ports.

The list of ports in some cases includes ports that are defined but not active or in some cases doesn’t include serial ports assigned to devices like modems. What a mess.

If anyone finds there way to this posting I wanted to give them a pointer to a site that helped me out a great deal. Check out Naughter Software’s EnumSerialPorts the shows 9 different ways to enumerate serial ports.

Thanks to PJ Naughter for putting this together and making it available to the rest of us.

No comments: