APG8201-B2
– Reference Manual
Version 1.00
www.acs.com.hk
Page 34 of 48
www.acs.com
.hk
9.2. Specific ScardControl
LONG SCardControl(
SCARDHANDLE hCard,
DWORD dwControlCode,
LPCVOID lpInBuffer,
DWORD nInBufferSize,
LPVOID lpOutBuffer,
DWORD nOutBufferSize,
LPDWORD lpBytesReturned
);
#define IOCTL_SMARTCARD_GET_FIRMWARE_VERSION SCARD_CTL_CODE(2078)
#define IOCTL_SMARTCARD_DISPLAY_LCD_MESSAGE SCARD_CTL_CODE(2079)
#define IOCTL_SMARTCARD_READ_KEY SCARD_CTL_CODE(2080
// PC/SC 2.0 Part 10
#define CM_IOCTL_GET_FEATURE_REQUEST SCARD_CTL_CODE(3400)
Note: Data is stored in little-endian form in which the LSB (Least Significant Byte) is first.
Furthermore, SCardControl command must be declared in the source code.
9.3. Smart Card Device IOCTLs
9.3.1.
CM_IOCTL_GET_FEATURE_REQUEST
The CM_IOCTL_GET_FEATURE_REQUEST returns a list of supported features from the reader.
hCard
Reference value returned from
SCardConnect
dwControlCode
CM_IOCTL_GET_FEATURE_REQUEST
lpInBuffer
NULL
nInBufferSize
Must be the
sizeof
(ULONG) of
IpInBuffer
lpOutBuffer
According to PC/SC 2.0 Specification Part 10, the following features had been
defined:
#define FEATURE_VERIFY_PIN_START 0x01
#define FEATURE_VERIFY_PIN_FINISH 0x02
#define FEATURE_MODIFY_PIN_START 0x03
#define FEATURE_MODIFY_PIN_FINISH 0x04
#define FEATURE_GET_KEY_PRESSED 0x05
#define FEATURE_VERIFY_PIN_DIRECT 0x06
#define FEATURE_MODIFY_PIN_DIRECT 0x07
#define FEATURE_MCT_READERDIRECT 0x08
#define FEATURE_MCT_UNIVERSAL 0x09
#define FEATURE_IFD_PIN_PROP 0x0A
#define FEATURE_ABORT 0x0B
In APG8201-B2, the following features are supported:
#define FEATURE_VERIFY_PIN_DIRECT 0x06
#define FEATURE_MODIFY_PIN_DIRECT 0x07
#define FEATURE_IFD_PIN_PROP 0x0A
#define FEATURE_WRITE_DISPLAY 0x0F
#define FEATURE_GET_KEY 0x10
#define FEATURE_IFD_DISPLAY_PROPERTIES 0x11