Article View: borland.public.cppbuilder.nativeapi
Article #1902Re: USB Device Detection
From: AlexB
Date: Fri, 01 Jun 2007 03:44
Date: Fri, 01 Jun 2007 03:44
25 lines
1681 bytes
1681 bytes
Anthony wrote: > ...when I plug in > the devices I have to unplug and plug in the USB cable to initiate the > USB hardware detection routine so that the device can be accessed by > the OS. I would really like to get away from the unplug/plug step and > was thinking I should be able to do it programmatically with a small > program. ... > Any suggestions ... You can use MS utility DevCon.exe. Example: restart all devices with VID=0x0547 and PID=0x2005 devcon.exe restart "@USB\VID_0547&PID_2005\*" This utility is very useful when something goes wrong and you have to restart driver and start the enumeration without device unplugging. Do not forget to wait the end of work of the utility before continue (for example with WinExecAndWait32 by Peter Below). And some devices (based on Cypress chip) do enumeration twice so for them it is necessary to add an additional pause. -- Alex.
Technical Details
Message-ID:
<465f9601$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<vluu53p1td3u3tiir0rqo3fd29sicr7cdc@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,487f80d121183d21 X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "AlexB" <b.a.v@inbox.ru> Subject: Re: USB Device Detection Newsgroups: borland.public.cppbuilder.nativeapi References: <vluu53p1td3u3tiir0rqo3fd29sicr7cdc@4ax.com> User-Agent: XanaNews/1.18.1.6 NNTP-Posting-Host: 212.192.185.54 Message-ID: <465f9601$1@newsgroups.borland.com> Date: 31 May 2007 20:44:01 -0700 X-Trace: newsgroups.borland.com 1180669441 212.192.185.54 (31 May 2007 20:44:01 -0700) Lines: 25 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail