|
-
Dec 22nd, 2005, 12:25 PM
#1
Thread Starter
Member
USB Port searching
I'm writing user software which configures the firmware for an electronic device.
It computer is linked to the device via USB.
How do you find which number port to write for?
I can set up a search to find used ports, but if the user has a device using port 4 for example, how can I check it is a USB device?
I am using VB6.
Thanks guys
-
Dec 22nd, 2005, 01:11 PM
#2
Re: USB Port searching
Opens that driver a virtual comm port? Then try to open in VB via MSCOMM ports 1 to 16. React on the error codes.
-
Dec 23rd, 2005, 05:58 AM
#3
Thread Starter
Member
Re: USB Port searching
MSCOMM was a good start, thanks.
I get error code 8002 - invalid port number if the port doesn't exist, which is great.
If there are 2 ports that are being used, how can I tell which is the virtual USB port please?
-
Dec 23rd, 2005, 06:29 AM
#4
Re: USB Port searching
Sometimes 2 ports are used. However 1 port you will use for communication. With MSCOMM its a little problem to get the descriptions. (With API's you can get descriptions but these descriptions are sometimes not reliable).
What I normally do is just try wich one is the good one and store that port for next session. With BlueTooth you must build in a delay for testing if the port is open or not. Sometimes even 2 sec!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|