Changeset 1588
- Timestamp:
- 02/16/10 21:11:16 (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/csctapi/icc_async.c
r1578 r1588 292 292 break; 293 293 case ATR_PROTOCOL_TYPE_T1: 294 call (Protocol_T1_Command (command, command_len, rsp)); 295 break; 294 { 295 int try = 1; 296 do { 297 if (Protocol_T1_Command (command, command_len, rsp) == OK) 298 break; 299 try++; 300 //try to resync 301 APDU_Rsp ** rsp; 302 unsigned char resync[] = { 0x21, 0xC0, 0x00, 0xE1 }; 303 Protocol_T1_Command (resync, sizeof(resync), rsp); 304 ifsc = DEFAULT_IFSC; 305 } while (try <= 3); 306 break; 307 } 296 308 case ATR_PROTOCOL_TYPE_T14: 297 309 call (Protocol_T14_ExchangeTPDU (command, command_len, rsp)); -
trunk/csctapi/ifd_cool.c
r1584 r1588 11 11 #include"../globals.h" 12 12 #include"icc_async.h" 13 14 #define OK 015 #define ERROR 116 13 17 14 void * handle; -
trunk/csctapi/protocol_t1.c
r1581 r1588 55 55 bool more; 56 56 if (command[1] == T1_BLOCK_S_IFS_REQ) 57 { 58 BYTE inf = command[3]; 59 60 /* Create an IFS request S-Block */ 61 block = T1_Block_NewSBlock (T1_BLOCK_S_IFS_REQ, 1, &inf); 62 cs_debug_mask (D_IFD,"Protocol: Sending block S(IFS request, %d)\n", inf); 63 64 /* Send IFSD request */ 65 ret = Protocol_T1_SendBlock (block); 66 67 /* Receive a block */ 68 ret = Protocol_T1_ReceiveBlock (&block); 69 70 if (ret == OK) 71 { 72 rsp_type = T1_Block_GetType (block); 73 74 /* Positive IFS Response S-Block received */ 75 if (rsp_type == T1_BLOCK_S_IFS_RES) 76 { 77 /* Update IFSD value */ 78 inf = (*T1_Block_GetInf (block)); 79 cs_debug_mask (D_IFD,"Protocol: Received block S(IFS response, %d)\n", inf); 80 } 81 } 82 83 return ret; 84 } 57 { 58 BYTE inf = command[3]; 59 60 /* Create an IFS request S-Block */ 61 block = T1_Block_NewSBlock (T1_BLOCK_S_IFS_REQ, 1, &inf); 62 cs_debug_mask (D_IFD,"Protocol: Sending block S(IFS request, %d)\n", inf); 63 64 /* Send IFSD request */ 65 ret = Protocol_T1_SendBlock (block); 66 67 /* Receive a block */ 68 ret = Protocol_T1_ReceiveBlock (&block); 69 70 if (ret == OK) 71 { 72 rsp_type = T1_Block_GetType (block); 73 74 /* Positive IFS Response S-Block received */ 75 if (rsp_type == T1_BLOCK_S_IFS_RES) 76 { 77 /* Update IFSD value */ 78 inf = (*T1_Block_GetInf (block)); 79 cs_debug_mask (D_IFD,"Protocol: Received block S(IFS response, %d)\n", inf); 80 } 81 } 82 83 return ret; 84 } 85 86 if (command[1] == T1_BLOCK_S_RESYNCH_REQ) 87 { 88 /* Create an Resynch request S-Block */ 89 block = T1_Block_NewSBlock (T1_BLOCK_S_RESYNCH_REQ, 0, NULL); 90 cs_debug_mask (D_IFD,"Protocol: Sending block S(RESYNCH request)\n"); 91 92 /* Send request */ 93 ret = Protocol_T1_SendBlock (block); 94 95 /* Receive a block */ 96 ret = Protocol_T1_ReceiveBlock (&block); 97 98 if (ret == OK) 99 { 100 rsp_type = T1_Block_GetType (block); 101 102 /* Positive IFS Response S-Block received */ 103 if (rsp_type == T1_BLOCK_S_RESYNCH_RES) { 104 cs_debug_mask (D_IFD,"Protocol: Received block S(RESYNCH response)\n"); 105 ns = 0; 106 } 107 } 108 109 return ret; 110 } 85 111 86 112 /* Calculate the number of bytes to send */ -
trunk/module-monitor.c
r1584 r1588 274 274 switch(reader[i].typ) // TODO like ph 275 275 { 276 276 case R_MOUSE : ctyp="mouse"; break; 277 277 case R_INTERNAL: ctyp="intern"; break; 278 278 case R_SMART : ctyp="smartreader"; break; 279 279 case R_CAMD35 : ctyp="camd 3.5x";break; 280 280 case R_CAMD33 : ctyp="camd 3.3x";break; 281 case R_CCCAM : ctyp="cccam"; break; 281 282 case R_NEWCAMD : ctyp="newcamd"; break; 282 283 case R_RADEGAST: ctyp="radegast"; break; -
trunk/reader-common.c
r1585 r1588 335 335 { 336 336 int rc=-1, r, m=0; 337 static int loadbalanced_idx = 1;337 static int loadbalanced_idx = 0; 338 338 if( (rc=reader_checkhealth()) ) 339 339 { 340 //cs_ log("OUT: ridx = %d (0x%x), client = 0x%x, lb_idx = %d", ridx, &reader[ridx], &client[cs_idx], loadbalanced_idx);340 //cs_debug("OUTER: ridx = %d (0x%x), client = 0x%x, lb_idx = %d", ridx, &reader[ridx], &client[cs_idx], loadbalanced_idx); 341 341 if(((reader[ridx].caid[0]>>8)==((er->caid>>8)&0xFF)) && (((reader[ridx].loadbalanced) && (loadbalanced_idx == ridx)) || !reader[ridx].loadbalanced)) 342 342 { 343 //cs_ log("IN: ridx = %d (0x%x), client = 0x%x, lb_idx = %d", ridx, &reader[ridx], &client[cs_idx], loadbalanced_idx);343 //cs_debug("INNER: ridx = %d (0x%x), client = 0x%x, lb_idx = %d", ridx, &reader[ridx], &client[cs_idx], loadbalanced_idx); 344 344 client[cs_idx].last_srvid=er->srvid; 345 345 client[cs_idx].last_caid=er->caid; … … 371 371 for (r=0;r<CS_MAXREADER;r++) 372 372 if (reader[r].caid[0]) m++; 373 if (loadbalanced_idx++ >= m) loadbalanced_idx = 1;373 if (loadbalanced_idx++ >= m) loadbalanced_idx = 0; 374 374 return(rc); 375 375 }
Note:
See TracChangeset
for help on using the changeset viewer.