#include <PCSC/ifdhandler.h>
RESPONSECODE IFDHTransmitToICC(DWORD Lun,
SCARD_IO_HEADER SendPci,
PUCHAR TxBuffer,
DWORD TxLength,
PUCHAR RxBuffer,
PDWORD RxLength,
PSCARD_IO_HEADER RecvPci);
| Lun | IN | Logical Unit Number |
| SendPci | IN | Protocol structure |
| TxBuffer | IN | APDU to be sent |
| TxLength | IN | Length of sent APDU |
| RxBuffer | OUT | APDU response |
| RxLength | INOUT | Length of APDU response |
| RecvPci | INOUT | Receive protocol structure |
This function performs an APDU exchange with the card/slot specified by Lun. The driver is responsible for performing any protocol specific exchanges such as T=0, 1, etc. differences. Calling this function will abstract all protocol differences.
T=0 ... T=14
Example: "\x00\xA4\x00\x00\x02\x3F\x00"
Example: "\x61\x14"
This function will be passed the size of the buffer of RxBuffer and this function is responsible for setting this to the length of the received APDU response. This should be ZERO on all errors. The resource manager will take responsibility of zeroing out any temporary APDU buffers for security reasons.
T=0 ... T=14
Notes:
The driver is responsible for knowing what type of card it has. If the current slot/card contains a memory card then this command should ignore the Protocol and use the MCT style commands for support for these style cards and transmit them appropriately. If your reader does not support memory cards or you don't want to implement this functionality, then ignore this.
RxLength should be set to zero on error.
The driver is not responsible for doing an automatic Get Response command for received buffers containing 61 XX.
| IFD_SUCCESS | Success |
| IFD_COMMUNICATION_ERROR | An error has occurred |
| IFD_RESPONSE_TIMEOUT | The response timed out |
| IFD_ICC_NOT_PRESENT | ICC is not present |
| IFD_PROTOCOL_NOT_SUPPORTED | Protocol is not supported |
| IFD_NO_SUCH_DEVICE | The reader is no more present |
Ludovic Rousseau 2008-01-18