Digital Me

Random contributions to digital noise

In my earlier post I was using libhid however due to it’s alleged problems with multi-threading I decided to use PyUSB instead. The code is a bit different, however a little shorter and simpler.

One notable thing to be aware of is that device I’m using is HID device and Linux is automatically loading HID drivers for it so it needs to be unloaded for PyUSB to continue working. That’s done by calling dev.detachkernel_driver(0)_ I suppose the device is used as vendor-specific device then, but who cares.

Anyway, here’s the code, should be a bit simpler than before:




Comments

New comment

required, won't be displayed

optional

Don't type anything here unless you're an evil robot:


And especially don't type anything here:

Basic XHTML (including links) is allowed, just don't try anything fishy. Your comment will be auto-formatted unless you use your own <p> tags for formatting. You're also welcome to use Textile.

Copyright © 2012 Mihailo Lalevic. All rights reserved.
Powered by Thoth.