473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Resetting the USB bus

I am trying to Reset the USB bus.

I have a system with various USB devices attached to it including video
capture devices. Occasionally some of the USB devices either disappear or
fail to operate. Restarting the computer or unplugging and replugging the
device corrects this, however this is not a viable solution while the system
is running.

I'm looking for a way of resetting or re-initializing the USB bus or the USB
hub in the hope that this will reset the device. I can detect when the device
is not present in the software and therefore when to attempt to reset the
device or USB bus.

I tried the following code (in C#) to reset the USB line, but it throws an
exception:
public static void ListUSB()
{
System.Management.ObjectQuery objectQuery =
//new System.Management.ObjectQuery("select * from CIM_USBController");
new System.Management.ObjectQuery("select * from CIM_USBHub");

// search and get the list
System.Management.ManagementObjectSearcher searcher = new
System.Management.ManagementObjectSearcher(objectQ uery);
System.Management.ManagementObjectCollection list = searcher.Get();

// step through the list of devices
foreach (System.Management.ManagementObject item in list)
{
item.InvokeMethod("Reset", null);
}
}
I have tried this with the CIM_USBHub and CIM_USBController classes.

Can anyone help or does anyone know how to do this?

Thanks
--
Richard
Jan 18 '06 #1
1 2361
Hi Richard,

There are several replies to your questions in wmi and kernel newsgroup,
please follow up there. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights
Jan 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: The Plankmeister | last post by:
Hi... I'm getting to grips with custom error handling, and am wondering if it is possible to somehow reset all the content already sent to the browser, and send some new stuff in its place. ...
8
by: riprod | last post by:
Someone in the IIS newsgroup suggest I post this here, so sorry in advance for the cross posting. I have a Win 2003 SP1 with IIS 6 and host about 40 websites, most of them useing ASP/VB with...
1
by: Frantic3d | last post by:
I just started using Access' Template file "Time & Billing Database" Well among other items I need to change the biggest right now is resetting the Client, Employee, Project ID #'s to start at 1. ...
2
by: DeveloperPDX | last post by:
I am creating a page and I need to add a reset button (like you would with HTML forms). Is there any way to do this other than resetting individual controls? Basically I need to page to return to...
1
by: Matthew Wieder | last post by:
Hi - I wanted to capture the enter button on a form since I have a datagrid with the first column being a delete button and if someone hits enter it deletes the first record. I coded: private...
3
by: No One | last post by:
This seems to be related to the ViewState error that is now starting to plague ASP.Net apps. When the Application Pool is recycled, the Session seems to be getting reset. When this is done,...
0
by: Padma | last post by:
Hi, I'm working in Visual Studio 2005. I created a simple add-in and installed it. It got added to the 'Tools' menu in the IDE and '.addin file' got copied to '..\My Documents\Visual Studio...
4
by: Ian Davies | last post by:
Hello I am struggling for a solution to clear some fields on my webpage that takes their values from some sessions My solution below works when the button is clicked twice. I sort of know why I...
8
by: Kevin | last post by:
I'm using a form where users can input a bunch of info into unbound text controls that are used in series of calculations. At the bottom is a "reset" button. I want to clear out all of the user...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.