Changeset 3953 for trunk/csctapi
- Timestamp:
- 11/21/10 11:56:38 (13 years ago)
- Location:
- trunk/csctapi
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/csctapi/io_serial.c
r3900 r3953 430 430 } 431 431 432 cs_debug ("IO: Receiving: ");433 432 for (count = 0; count < size ; count++) 434 433 { … … 446 445 gettimeofday(&tv_spent,0); 447 446 } 448 if(!readed) return ERROR;449 450 data[count] = c;451 cs_debug_nolf ("%02X ", c);447 if(!readed) { 448 cs_ddump(data, count, "IO: Receiving:"); 449 return ERROR; 450 } 452 451 #else 453 452 if (!IO_Serial_WaitToRead (reader, 0, timeout)) … … 455 454 if (read (reader->handle, &c, 1) != 1) 456 455 { 456 cs_ddump(data, count, "IO: Receiving:"); 457 457 cs_log("ERROR in IO_Serial_Read errno=%d", errno); 458 458 tcflush (reader->handle, TCIFLUSH); 459 459 return ERROR; 460 460 } 461 data[count] = c;462 cs_debug_nolf ("%02X ", c);463 461 } 464 462 else 465 463 { 464 cs_ddump(data, count, "IO: Receiving:"); 466 465 cs_debug("TIMEOUT in IO_Serial_Read"); 467 466 tcflush (reader->handle, TCIFLUSH); … … 469 468 } 470 469 #endif 471 } 472 cs_debug_nolf("\n"); //UGLY this is essential, resets global var, do not delete 470 data[count] = c; 471 } 472 cs_ddump(data, count, "IO: Receiving:"); 473 473 return OK; 474 474 } -
trunk/csctapi/protocol_t0.c
r3799 r3953 137 137 return Protocol_T0_ExchangeTPDU(reader, command, command_len, rsp, lr); 138 138 default: 139 cs_debug_mask (D_IFD,"Protocol: T=0: Invalid APDU \n");139 cs_debug_mask (D_IFD,"Protocol: T=0: Invalid APDU"); 140 140 return ERROR; 141 141 } -
trunk/csctapi/protocol_t1.c
r3223 r3953 59 59 /* Create an IFS request S-Block */ 60 60 block = T1_Block_NewSBlock (T1_BLOCK_S_IFS_REQ, 1, &inf); 61 cs_debug_mask (D_IFD,"Protocol: Sending block S(IFS request, %d) \n", inf);61 cs_debug_mask (D_IFD,"Protocol: Sending block S(IFS request, %d)", inf); 62 62 63 63 /* Send IFSD request */ … … 76 76 /* Update IFSD value */ 77 77 inf = (*T1_Block_GetInf (block)); 78 cs_debug_mask (D_IFD,"Protocol: Received block S(IFS response, %d) \n", inf);78 cs_debug_mask (D_IFD,"Protocol: Received block S(IFS response, %d)", inf); 79 79 } 80 80 } … … 87 87 /* Create an Resynch request S-Block */ 88 88 block = T1_Block_NewSBlock (T1_BLOCK_S_RESYNCH_REQ, 0, NULL); 89 cs_debug_mask (D_IFD,"Protocol: Sending block S(RESYNCH request) \n");89 cs_debug_mask (D_IFD,"Protocol: Sending block S(RESYNCH request)"); 90 90 91 91 /* Send request */ … … 101 101 /* Positive IFS Response S-Block received */ 102 102 if (rsp_type == T1_BLOCK_S_RESYNCH_RES) { 103 cs_debug_mask (D_IFD,"Protocol: Received block S(RESYNCH response) \n");103 cs_debug_mask (D_IFD,"Protocol: Received block S(RESYNCH response)"); 104 104 reader->ns = 0; 105 105 } … … 121 121 /* Create an I-Block */ 122 122 block = T1_Block_NewIBlock (bytes, command, reader->ns, more); 123 cs_debug_mask (D_IFD,"Sending block I(%d,%d) \n", reader->ns, more);123 cs_debug_mask (D_IFD,"Sending block I(%d,%d)", reader->ns, more); 124 124 125 125 /* Send a block */ … … 133 133 /* Positive ACK R-Block received */ 134 134 if (rsp_type == T1_BLOCK_R_OK) { 135 cs_debug_mask (D_IFD,"Protocol: Received block R(%d) \n", T1_Block_GetNR (block));135 cs_debug_mask (D_IFD,"Protocol: Received block R(%d)", T1_Block_GetNR (block)); 136 136 /* Delete block */ 137 137 T1_Block_Delete (block); … … 149 149 /* Create an I-Block */ 150 150 block = T1_Block_NewIBlock (bytes, command + counter, reader->ns, more); 151 cs_debug_mask (D_IFD,"Protocol: Sending block I(%d,%d) \n", reader->ns, more);151 cs_debug_mask (D_IFD,"Protocol: Sending block I(%d,%d)", reader->ns, more); 152 152 153 153 /* Send a block */ … … 189 189 if (rsp_type == T1_BLOCK_I) 190 190 { 191 cs_debug_mask (D_IFD,"Protocol: Received block I(%d,%d) \n",191 cs_debug_mask (D_IFD,"Protocol: Received block I(%d,%d)", 192 192 T1_Block_GetNS(block), T1_Block_GetMore (block)); 193 193 /* Calculate nr */ … … 210 210 /* Create an R-Block */ 211 211 block = T1_Block_NewRBlock (T1_BLOCK_R_OK, nr); 212 cs_debug_mask (D_IFD,"Protocol: Sending block R(%d) \n", nr);212 cs_debug_mask (D_IFD,"Protocol: Sending block R(%d)", nr); 213 213 214 214 /* Send R-Block */ … … 222 222 /* Get wtx multiplier */ 223 223 wtx = (*T1_Block_GetInf (block)); 224 cs_debug_mask (D_IFD,"Protocol: Received block S(WTX request, %d) \n", wtx);224 cs_debug_mask (D_IFD,"Protocol: Received block S(WTX request, %d)", wtx); 225 225 226 226 /* Delete block */ … … 229 229 /* Create an WTX response S-Block */ 230 230 block = T1_Block_NewSBlock (T1_BLOCK_S_WTX_RES, 1, &wtx); 231 cs_debug_mask (D_IFD,"Protocol: Sending block S(WTX response, %d) \n", wtx);231 cs_debug_mask (D_IFD,"Protocol: Sending block S(WTX response, %d)", wtx); 232 232 233 233 /* Send WTX response */
Note:
See TracChangeset
for help on using the changeset viewer.