thirtysixthspan / magtek_card_reader

Provides a convenient wrapper around libusb to read credit cards with a Magtek Credit Card Reader
MIT License
21 stars 1 forks source link

flexible buffer length checking #4

Open mfrederickson opened 11 years ago

mfrederickson commented 11 years ago

This is a work around for #3. You can have the buffer length check turned off by passing in required_buffer_length: 0 to the read method like this (otherwise it defaults to 337):

mcr.read timeout: 10000, required_buffer_length: 0

This commit also includes changing from an explicit interrupt_transfer call to using the interrupt_transfer call on the device handle so that we don't have to worry with buffer management.