ACR1281U-C8 – Application Programming Interface
Version 1.00
www.acs.com.hk
Page 40 of 52
6.0. Card Commands for ISO14443-4 Interface
6.1. PICC_Xch_APDU
Format:
DLLAPI INT16 AC_DECL PICC_Xch_APDU (
INT16 rHandle,
BOOL typeA,
INT16 *pTransmitLength,
UINT8 *pxData,
INT16 *pReceiveLength,
UINT8 *prData);
Function Description:
This function handles the APDU exchange in T=CL protocol. This routine will handle the Frame
Waiting Time Extension (WTX) and chaining for long messages.
Parameters
Description
rHandle
Handle to the reader returned by ACR120_Open()
typeA
A Boolean value indicates the card type,
TRUE for type A cards, FALSE for type B cards
pTransmitLength
A pointer to the location storing the length of the data
to transmit, in bytes
pxData
A pointer to the transmit data storage
pReceiveLength
A pointer to the location storing the length of the data
received, in bytes
prData
A pointer to the receive data storage
Return Value
INT16
Result code. 0 means success.
Table 29
: PICC_Xch_APDU Command Description
Returns:
The return value is 0 if the function is successful. Otherwise, it returns a negative value containing the
error code. For the detailed meaning of the error code, please refer to
Notes:
1. The function
PICC_InitBlockNumber()
should be called each time between the
ACR120_Select()
or
ACR120_MultiTagSelect()
function and this function.
2. In many cases, the status code SW1 and SW2 are the last 2 bytes of the received data.
Example:
INT16 rHandle;
UINT8 SID;
BOOT typeA;
INT16 xLen, rLen;
UINT rData[100];