/[pcsclite]/trunk/Drivers/ccid/src/ccid_usb.c
ViewVC logotype

Diff of /trunk/Drivers/ccid/src/ccid_usb.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 569 by rousseau, Tue Oct 28 18:18:11 2003 UTC revision 570 by rousseau, Tue Dec 16 10:11:09 2003 UTC
# Line 36  Line 36 
36  #include "ccid.h"  #include "ccid.h"
37    
38    
39  #define USB_TIMEOUT (60 * 1000) /* 1 minute timeout */  /* read timeout
40     * we must wait enough so that the card can finish its calculation
41     * the card, and then the reader should send TIME REQUEST bytes
42     * so this timeout should never occur */
43    #define USB_READ_TIMEOUT (60 * 1000)    /* 1 minute timeout */
44    
45    /* write timeout
46     * we don't have to wait a long time since the card was doing nothing */
47    #define USB_WRITE_TIMEOUT (5 * 1000)  /* 5 seconds timeout */
48    
49    
50  #define BUS_DEVICE_STRSIZE 32  #define BUS_DEVICE_STRSIZE 32
51    
# Line 288  status_t WriteUSB(int lun, int length, u Line 297  status_t WriteUSB(int lun, int length, u
297          DEBUG_XXD(debug_header, buffer, length);          DEBUG_XXD(debug_header, buffer, length);
298  #endif  #endif
299    
300          rv = usb_bulk_write(usbDevice[reader].handle, usbDevice[reader].bulk_out, buffer, length, USB_TIMEOUT);          rv = usb_bulk_write(usbDevice[reader].handle, usbDevice[reader].bulk_out, buffer, length, USB_WRITE_TIMEOUT);
301    
302          if (rv < 0)          if (rv < 0)
303          {          {
# Line 317  status_t ReadUSB(int lun, int * length, Line 326  status_t ReadUSB(int lun, int * length,
326  #endif  #endif
327    
328    
329          rv = usb_bulk_read(usbDevice[reader].handle, usbDevice[reader].bulk_in, buffer, *length, USB_TIMEOUT);          rv = usb_bulk_read(usbDevice[reader].handle, usbDevice[reader].bulk_in, buffer, *length, USB_READ_TIMEOUT);
330          *length = rv;          *length = rv;
331    
332          if (rv < 0)          if (rv < 0)

Legend:
Removed from v.569  
changed lines
  Added in v.570

  ViewVC Help
Powered by ViewVC 1.1.5