Reputation: 996
I have an RFID reader that works as a Keyboard, so, if I click on a Text Entry and put a card near the reader, it puts the content read on the text entry. The latest RFID reader I was using works via serial connection, so I can open and close the connection to avoid fake positives, but with this new model, I can't do that, so I need to disable and enable the device without unplug it from the USB, just like if I do from the Windows Device Manager.
I have tried with pyusb
but, in Windows, it doesn't display nothing, (I have tried the same on my RPi 3 and it works properly, but I don't know if I could disable the port).
By the way, I also tried with infi.devicemanager
but this only list all peripherals connected and doesn't let me disable/enable it.
Is there any way to do this, like edit the registry, or acess it via cmd prompt.
Thanks!
Upvotes: 1
Views: 5242
Reputation: 444
There is command line tool for this called DevCon. You can disable devices using devcon-disable command. It's supported by Microsoft and since it's a command line tool you can use it programmatically. Here is an example.
Upvotes: 2