APG8201-B2
– Reference Manual
Version 1.00
www.acs.com.hk
Page 30 of 48
www.acs.com
.hk
8.0. PC-linked Operation Mode
During PC-linked mode, the user can choose the SPE as the authentication between a card and the
reader. When it operates in standalone mode, the user can choose the unconnected mode PLA and
value-added function such as the calculator.
When the reader is in PC-linked mode, user can choose PCSC API
SCardConnect
,
SCardTransmit
,
SCardControl
, etc. to send commands to the reader to do some basic operations between the card
and the reader.
SCardControl
API can be used to do the Secure Pin Verify, Secure Pin Modify and
different escape commands communication.
8.1. SCardConnect API
LONG WINAPI SCardConnect(
_In_ SCARDCONTEXT hContext,
_In_ LPCTSTR szReader,
_In_ DWORD dwShareMode,
_In_ DWORD dwPreferredProtocols,
_Out_ LPSCARDHANDLE phCard,
_Out_ LPDWORD pdwActiveProtocol
);
8.2. SCardTransmit API
LONG WINAPI SCardTransmit(
_In_ SCARDHANDLE hCard,
_In_ LPCSCARD_IO_REQUEST pioSendPci,
_In_ LPCBYTE pbSendBuffer,
_In_ DWORD cbSendLength,
_Inout_opt_ LPSCARD_IO_REQUEST pioRecvPci,
_Out_ LPBYTE pbRecvBuffer,
_Inout_ LPDWORD pcbRecvLength
);
8.3. SCardControl API
LONG WINAPI SCardControl(
_In_ SCARDHANDLE hCard,
_In_ DWORD dwControlCode,
_In_ LPCVOID lpInBuffer,
_In_ DWORD nInBufferSize,
_Out_ LPVOID lpOutBuffer,
_In_ DWORD nOutBufferSize,
_Out_ LPDWORD lpBytesReturned
);
8.4. SECURE PIN VERIFY
The application sends a command to logon (SPE secure pin entry):
e.g.
“00 20 00 01 08 24 12 34 FF FF FF FF FFh”
The user enters a pin and the reader sends the SECURE PIN VERIFY command to the card.
Specific Status Codes
SW1 SW2
Meaning
90 00h
No error
63 Cxh
Wrong PIN