From ba19605333a314d8c285972d165e83f4602b1877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 26 Nov 2013 12:00:42 +0100 Subject: support PVM110 cards --- libk8055/libk8055.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libk8055/libk8055.c b/libk8055/libk8055.c index cea2587..23645c9 100644 --- a/libk8055/libk8055.c +++ b/libk8055/libk8055.c @@ -122,8 +122,12 @@ void k8055_free( struct k8055_dev* dev ) { int k8055_read( struct k8055_dev* dev ) { if( dev->dev_no==0 ) return K8055_ERROR; int length; + int r, n; for( int i=0; iusb_handle, USB_INP_EP, dev->data_in, PACKET_LEN, &length, USB_TIMEOUT )==0 && ( length==PACKET_LEN ) && ( dev->data_in[1]==dev->dev_no ) ) return 0; + r = libusb_interrupt_transfer(dev->usb_handle, USB_INP_EP, dev->data_in, PACKET_LEN, &length, USB_TIMEOUT); + n = dev->data_in[1] & 0xf; + if (n > 4) n -= 10; + if (r==0 && ( length==PACKET_LEN ) && ( n==dev->dev_no ) ) return 0; if( dev->debug_level>0 ) fprintf( stderr, "k8055 read retry\n" ); } return K8055_ERROR; -- cgit v1.1-2-g2b99