Changeset 1010
- Timestamp:
- 12/31/09 05:33:46 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/smartreader/reader-pcsc.c
r1007 r1010 84 84 SCARD_IO_REQUEST pioRecvPci; 85 85 DWORD dwSendLength, dwRecvLength; 86 if(buf[4]) 87 dwSendLength = l; 88 else 89 dwSendLength = l-1; 86 90 87 91 88 dwRecvLength = CTA_RES_LEN; … … 93 90 94 91 if(pcsc_reader->dwActiveProtocol == SCARD_PROTOCOL_T0) { 92 // explanantion as to why we do the test on buf[4] : 93 // Issuing a command without exchanging data : 94 //To issue a command to the card that does not involve the exchange of data (either sent or received), the send and receive buffers must be formatted as follows. 95 //The pbSendBuffer buffer must contain the CLA, INS, P1, and P2 values for the T=0 operation. The P3 value is not sent. (This is to differentiate the header from the case where 256 bytes are expected to be returned.) 96 //The cbSendLength parameter must be set to four, the size of the T=0 header information (CLA, INS, P1, and P2). 97 //The pbRecvBuffer will receive the SW1 and SW2 status codes from the operation. 98 //The pcbRecvLength should be at least two and will be set to two upon return. 99 if(buf[4]) 100 dwSendLength = l; 101 else 102 dwSendLength = l-1; 95 103 rv = SCardTransmit(pcsc_reader->hCard, SCARD_PCI_T0, buf, dwSendLength, &pioRecvPci, cta_res, &dwRecvLength); 96 104 } 97 105 else if(pcsc_reader->dwActiveProtocol == SCARD_PROTOCOL_T1) { 106 dwSendLength = l; 98 107 rv = SCardTransmit(pcsc_reader->hCard, SCARD_PCI_T1, buf, dwSendLength, &pioRecvPci, cta_res, &dwRecvLength); 99 108 }
Note:
See TracChangeset
for help on using the changeset viewer.