AnsweredAssumed Answered

vrf Available serial ports

Question asked by VRFuser on Jan 21, 2008
> We'll see what they say.

Hopefully it's a known issue & they can take care of it right away. I can't really think of anything off the top of my head that happened to XP's serial handling with SP2, but then there are *so* many things.

> Unfortunately, I think the GreenLeaf
> Open() code has a problem and it is
> occurring both when I test for
> available ports and also when I open
> a port for real.

Probably. You know, it's not too terribly awful hard to use the raw API to test availability of ports. All you really need to do is call CreateFile with a filename parameter of \.COMxx and see if INVALID_HANDLE_VALUE is returned. If not, call CloseHandle on the returned value and note that the port is available. You can check a huge range of ports very fast. This will work for ports from COM1 to COM9999.

In fact, you can probably adapt GetDevices to do what you want. This will give you all COM ports pretty fast. If you change it to test only COM ports or filter the results for only COM ports before it tests availability it'll be even faster. It took an AMD 2.07GHz 4 seconds to return the names & accessibility status of 193 devices. This is much, MUCH faster than any ActiveX equivalent would be for the same info.

GetDevices is in RWilson3.vee:
http://www.vrfarchive.com/SearchVRF.php?mi=10419

Naturally I have to say that at the time (2004) the comments I made about Linux were on the verge of becoming history with the new kernel release.
Linux does dynamic drivers now. We generally don't care I know, but there are probably some Linux fans that will point this out. And I wouldn't want to get Linus POed at me! The dude can be brutal
-SHAWN-




---
You are currently subscribed to vrf as: ming_meng@agilent.com To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "http://www.vrfarchive.com/vrf_archive".
Search the Agilent vrf archive at "http://vee.engineering.agilent.com".

Outcomes