Hey,

I'm a bit new to USB. I have a MagTek credit card reader that I'm
interfacing with Python.

When you swipe a card, the card data is sent on the "Interrupt In" pipe
using an 'Interrupt Report".

Now, I have already been able to read and parse the card data by using
open(), read(), and close() on /dev/usb/hiddev0, however, I would prefer to
interface using the USB library so that I can verify the right device is
connected and can reset the device. I also have the specs from the
manufacturer's website. I can't quite figure out how to use the usb module
though. This is all I have:

VENDOR_ID = 0x0801
PRODUCT_ID = 0x0002

buses = usb.busses()
for bus in buses:
    for device in bus.devices:
        if device.idVendor == VENDOR_ID and device.idProduct == PRODUCT_ID:
            print "Found MagTek card reader"
            # now how do I wait for a read?


So I can find my device using the usb module but I do not know how to wait
for and then read from the device. Can anybody point me in the right
direction?
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to