Smart Card Reader Driver Program Reference Manual
rev 1.1 Sept, 2003
Advanced Card Systems Ltd.
Page 13 of 34
Examples:
// Read 8 bytes from AM104 starting from address 0
INT16 RtnCode,i;
AC_APDU Apdu;
Apdu.CLA = 0x00; // Instruction Class
Apdu.INS = ACI_Read;
// Command
Apdu.P1
= 0x00;
// MSB of starting address
Apdu.P2
= 0x00;
// LSB of starting address
Apdu.Lc
= 0x00;
// No input data for this command
Apdu.Le
= 0x08;
// Read 8 bytes data
//Exchange APDU with the ACR10 reader
RtnCode = AC_ExchangeAPDU(hReader, &Apdu);
if (RtnCode >= 0)
{
// print the data
printf("Data : ");
for (i=0; i < (INT16) Apdu.Le; i++)
printf("
%02X",Apdu.DataOut[i]);
// print the status bytes
printf("Card Status(SW1 SW2)=%04X",Apdu.Status);
2.3.2.6 AC_GetInfo
This function retrieve information related to the currently selected reader.
Format :
INT16 AC_DECL AC_GetInfo (INT16 hReader, AC_INFO FAR *Info);
Input Parameters:
The table below lists the parameters for this function
Parameters
Definition / Values
hReader
A valid reader handle returned by AC_Open()
Output Parameters:
The table below lists the parameters returned by this function
Parameters
Definition / Values
Info.szRev
Revision code for the selected reader.
Info.nMaxC
The maximum number of command data bytes.
Info.nMaxR
The maximum number of data bytes that can be requested to be transmitted in a
response
Info.CType
The card types supported by this reader
Info.CStat
The current status of the reader
00
H
= no card inserted
01
H
= card inserted, not powered up
03
H
= card powered up
Info.CSel
The currently selected card type
Info.nLibVer
Current library version
(e.g. 310 is equal to version 3.10)