![Advanced Card ACR20 Program Reference Manual Download Page 12](http://html1.mh-extra.com/html/advanced-card/acr20/acr20_program-reference-manual_2855845012.webp)
Smart Card Reader Driver Program Reference Manual
rev 1.1 Sept, 2003
Advanced Card Systems Ltd.
Page 12 of 34
2.3.2.5 AC_ExchangeAPDU
This function sends an APDU command to a card via the opened port and returns the card's
response. Please refer Section 2.3.3 ACI Commands for detail description on how to fill in
the parameters.
Format:
INT16 AC_DECL AC_ExchangeAPDU (INT16 hReader, AC_APDU FAR *Apdu);
Input Parameters:
The table below listed the parameters for this function
Parameters
Definition / Values
hReader
A valid reader handle returned by AC_Open()
Apdu.CLA
Instruction Class (Please refer Section 2.3.3 ACI Commands for detail description)
Apdu.INS
Instruction Code (Please refer Section 2.3.3 ACI Commands for detail description)
Apdu.P1
Parameter 1 (Please refer Section 2.3.3 ACI Commands for detail description)
Apdu.P2
Parameter 2 (Please refer Section 2.3.3 ACI Commands for detail description)
Apdu.DataIn
Data buffer to send
Apdu.Lc
Number of bytes in Apdu.DataIn to be sent
Apdu.Le
Number of bytes expected to receive
Output Parameters:
The table below listed the parameters returned by this function
Parameters
Definition / Values
Apdu.DataOut
Data buffer containing the card response
Apdu.Le
Number of bytes received in Apdu.DataOut
Apdu.Status
Status bytes SW1, SW2 returned by the card
Returns:
The return value is zero 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
appendix A.