Changeset 4453
- Timestamp:
- 01/14/11 15:28:01 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/csctapi/icc_async.c
r4431 r4453 418 418 LOCK_SC8IN1; 419 419 420 switch (reader->protocol_type) { 420 int try = 1; 421 do { 422 switch (reader->protocol_type) { 423 if (try > 1) 424 cs_log("Warning: reader %s needed try nr %i, next ECM has some delay:", reader->label, try); 421 425 case ATR_PROTOCOL_TYPE_T0: 422 426 ret = Protocol_T0_Command (reader, command, command_len, rsp, lr); 423 427 break; 424 428 case ATR_PROTOCOL_TYPE_T1: 425 { 426 int try = 1; 427 do { 428 ret = Protocol_T1_Command (reader, command, command_len, rsp, lr); 429 if (ret == OK) 430 break; 431 try++; 429 ret = Protocol_T1_Command (reader, command, command_len, rsp, lr); 430 if (ret != OK) { 432 431 //try to resync 433 432 unsigned char resync[] = { 0x21, 0xC0, 0x00, 0xE1 }; 434 433 Protocol_T1_Command (reader, resync, sizeof(resync), rsp, lr); 435 434 reader->ifsc = DEFAULT_IFSC; 436 } while (try <= 3); 437 break; 438 } 435 } 436 break; 439 437 case ATR_PROTOCOL_TYPE_T14: 440 438 ret = Protocol_T14_ExchangeTPDU (reader, command, command_len, rsp, lr); … … 443 441 cs_log("Error, unknown protocol type %i",reader->protocol_type); 444 442 ret = ERROR; 445 } 443 } 444 try++; 445 } while ((try < 3) && (ret != OK)); //always do one retry when failing 446 446 447 447 UNLOCK_SC8IN1;
Note:
See TracChangeset
for help on using the changeset viewer.