Changeset 1010


Ignore:
Timestamp:
12/31/09 05:33:46 (12 years ago)
Author:
rorothetroll
Message:

resync with trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/smartreader/reader-pcsc.c

    r1007 r1010  
    8484     SCARD_IO_REQUEST pioRecvPci;
    8585     DWORD dwSendLength, dwRecvLength;
    86     if(buf[4])
    87         dwSendLength = l;
    88     else
    89         dwSendLength = l-1;
     86
    9087
    9188     dwRecvLength = CTA_RES_LEN;
     
    9390
    9491    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;
    95103        rv = SCardTransmit(pcsc_reader->hCard, SCARD_PCI_T0, buf, dwSendLength, &pioRecvPci, cta_res, &dwRecvLength);
    96104    }
    97105    else  if(pcsc_reader->dwActiveProtocol == SCARD_PROTOCOL_T1) {
     106        dwSendLength = l;
    98107        rv = SCardTransmit(pcsc_reader->hCard, SCARD_PCI_T1, buf, dwSendLength, &pioRecvPci, cta_res, &dwRecvLength);
    99108    }
Note: See TracChangeset for help on using the changeset viewer.