I would like to be able to programmatically disable or enable a USB hub to connect USB devices that are inaccessible or accessible to it, respectively. I did some testing using the device manager, and then using Devcon, and found that when certain devices are connected to the hub (in particular, to some Android phones), it cannot be immediately disconnected, and it is marked to disconnect after rebooting. I tried to overcome this problem by trying to also disconnect the problem devices connected to the hub, but this also failed. I also tried using the SetupDixxx API directly and even some USB IOCTLs, but I was not able to complete this task. I believe that there should be a way to force the immediate disconnection of the hub without rebooting. I would appreciate it if someone could point me on the right path.
Thanks in advance, Ziv
source share