How to sense the UIRT?

Interested in integrating USB-UIRT support into an application? Look here!

Moderator: jrhees

How to sense the UIRT?

Postby Dean Roddey » Fri Nov 12, 2004 6:43 am

Jon, I want to auto-sense that a UIRT is present so that I can auto-install my driver for it. I can find out your Vendor/Product ids easily enough, but what GUI id are you using in IoRegisterDeviceInterface so that I can enumerate devices of that interface and see if one of your guys is there?
Dean Roddey
 

Postby Guest » Fri Nov 12, 2004 6:44 am

BTW, I do check also for the presence of the DLL in the system path somewhere. But that doesn't mean that the device is actually present, since it could just be sitting around from ages ago or something. I want to make absolutely sure it's there, by making sure it's a present USB device.
Guest
 

Postby jrhees » Sat Nov 13, 2004 3:29 am

Dean,

The recommended method is using the API itself and actually calling Open() as normal. One of the possible error codes is that the device cannot be found.

So, you could simply

hHandle = UUIROpen()
if (hHandle == INVALID_HANDLE)
{
check error code
}
else
{
UUIRClose(hHandle);
}

-Jon
jrhees
Site Admin
 
Posts: 1652
Joined: Tue Jan 28, 2003 11:49 pm

Postby Guest » Sun Nov 14, 2004 6:14 pm

The thing is, I'm going to need to do this for more and more devices over time and I just cannot afford to load up custom DLLs for all of them (and write the code specfiically for each one.) Checking for the presence of a device with particular vendor/product id is something that can be done generically by just using hints read out of the CQC driver manifest files.
Guest
 

Postby jrhees » Mon Nov 15, 2004 3:42 pm

You can certainly do this, but two words of caution:

1. In my experience, this can be a maintenance nightmare because vendors routinely roll their internal asics and device ID's routinely change (even on the same model hardware).

2. Parsing the Windows' device tree for some types of devices can give confusing results -- Windows will keep some devices populated on the device tree even when they're unplugged, and some devices 'hide' underneath a host-controller's vendor and device ID (such as AC-97 devices, etc.).

-Jon
jrhees
Site Admin
 
Posts: 1652
Joined: Tue Jan 28, 2003 11:49 pm

Postby Dean Roddey » Wed Nov 17, 2004 4:26 am

Actually, it may turn out to be a moot point, because there appears to be absolutely no way to interate devices and find a non-HID device by way of its vendor/product id, because there is no generic way under Windows to query those ids except for HID devices (maybe there is at the driver level but not at the application level.)

But this is really problematic since it's just not going to be possible to generically look for a device, since there's no practical way to indicate in some data file that you have to load DLL X and call function Y with this and that data, since that data could be anything and I couldn't create it on the fly without knowing it's form it ahead of time.

So for systems like mine, that means really that no auto-sensing can be done in any practical way that isn't hard coded for every USB device. That's pretty sad. USB is supposed to be so auto-magical, but this limitation means I can really do better with serial and ethernet devices, in terms of auto-sensing them generically.
Dean Roddey
 

Postby jrhees » Thu Nov 18, 2004 5:28 am

Dean,

Actually, you *can* iterate using the DeviceManager Win32 calls. I've written code to do just that, although not for the same purpose. If you're interested in my code, let me know...

-Jon
jrhees
Site Admin
 
Posts: 1652
Joined: Tue Jan 28, 2003 11:49 pm


Return to Developers

Who is online

Users browsing this forum: No registered users and 25 guests

cron