PC/SC Guide
Prox–DU & Prox–SU
www.gemalto.com
DOC119811A Public Use Page 63/129
bIns An instruction code in the T=0 instruction class.
bP1, bP2 Reference codes that complete the instruction code.
bP3 The number of data bytes to be transmitted during the command, per ISO
7816-4, Section 8.2.1.
cbSendLength [in]
The length, in bytes, of the pbSendBuffer parameter.
For T=0, in the special case where no data is sent to the card and no data expected
in return, this length must reflect that the bP3 member is not being sent; the length
should be sizeof(CmdBytes) - sizeof(BYTE).
pioRecvPci [in, out, optional]
Pointer to the protocol header structure for the instruction, followed by a buffer in
which to receive any returned protocol control information (PCI) specific to the
protocol in use. This parameter can be NULL if no PCI is returned.
pbRecvBuffer [out]
Pointer to any data returned from the card.
For T=0, the data is immediately followed by the SW1 and SW2 status bytes. If no
data is returned from the card, then this buffer will only contain the SW1 and SW2
status bytes.
pcbRecvLength [in, out]
Supplies the length, in bytes, of the pbRecvBuffer parameter and receives the
actual number of bytes received from the smart card. This value cannot be
SCARD_AUTOALLOCATE because SCardTransmit does not support
SCARD_AUTOALLOCATE.
For T=0, the receive buffer must be at least two bytes long to receive the SW1 and
SW2 status bytes.
Return Value:
If the function successfully sends a service request to the smart card, the return value is
SCARD_S_SUCCESS.
If the function fails, it returns an error code. For more information, see Smart Card Return
Values.
Remarks:
The SCardTransmit function is a smart card and reader access function. For information
about other access functions, see Smart Card and Reader Access Functions.
For the T=0 protocol, the data received back are the SW1 and SW2 status codes, possibly
preceded by response data. The following paragraphs provide information about the send
and receive buffers used to transfer data and issue a command.
Sending data to the card :
To send n bytes of data to the card, where n>0, the send and receive buffers must
be formatted as follows.
The first four bytes of the pbSendBuffer buffer contain the CLA, INS, P1, and P2
values for the T=0 operation. The fifth byte must be set to n: the size, in bytes, of
the data to be transferred to the card. The next n bytes must contain the data to be
sent to the card.
The cbSendLength parameter must be set to the size of the T=0 header information
(CLA, INS, P1, and P2) plus a byte that contains the length of the data to be