On Fri, May 9, 2014 at 11:47 AM, Dm M <demoman....@gmail.com> wrote:
> Hi,
>
> I am having problems reading from a usb nfc device that acts like a
> keyboard. If I plug the device into my linux computer and scan a nfc tag, it
> outputs it out as if a keyboard was typing the keys:
>
>> $: 2352481416
>
>
> However when I try to isolate the device to capture output with pyusb I am
> unable to read anything from the device. In the code I posted below it just
> continually prints "[]", never reading any data. When I use ipython to read
> with a specified timeout (endpoing.read(129, 5000)), it always times out
> despite triggering a tag in the mean time.
>
> One thing I noticed is the iInterface number is 4, instead of 0, but I am
> not sure how to use that info.

Your pyusb code will most likely not work since you have not really
understood how your device works. The kernel HID driver and the
input event system shield you from the underlying communication
protocol between your device and the system. You need to understand
that before trying to use libusb/pyusb.

usbmon may help.
https://www.kernel.org/doc/Documentation/usb/usbmon.txt

The HID class specification may help as well.
http://www.usb.org/developers/devclass_docs/HID1_11.pdf

-- 
Xiaofan

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to