Page
60
of
70
Copyright © Access-IS 2016
A. NFC module serial number matching
The NFC module exposes a maximum of five CCID smartcard readers and one HID interface for
management. It may be possible that a system is connected to two or more modules. In this
scenario, the application software should perform serial number matching to determine which
readers are physically present together in one module. The interfaces with same serial numbers are
physically present together in one module.
The serial number of a CCID reader can be read using the
SCardGetAttrib
function.
The following piece of code shows an example of the
SCardGetAttrib
function.
// connect to smart card reader
lReturn = SCardConnect( hSC,
(LPCWSTR)pCardReaderName,
SCARD_SHARE_DIRECT,
NULL,
&hCardHandle,
NULL );
if ( SCARD_S_SUCCESS != lReturn )
{
Console::WriteLine("Failed SCardConnect\n");
exit(1); // Or other appropriate action.
}
// get reader serial no
LPBYTE pbAttr = NULL;
DWORD cByte = SCARD_AUTOALLOCATE;
lReturn = SCardGetAttrib(hCardHandle,
SCARD_ATTR_VENDOR_IFD_SERIAL_NO,
(LPBYTE)&pbAttr,
&cByte);
if ( SCARD_S_SUCCESS != lReturn )
{
Console::WriteLine("Failed to retrieve Reader Serial\n");
exit(1); // Or other appropriate action.
}
printf("serial no: %s", pbAttr);
For more information on the
SCardGetAttrib
function, please refer to the Microsoft website.
Similar to the CCID readers, you can retrieve the serial number of the HID interface using the
HidD_GetSerialNumberString
function. Please refer to the Microsoft website for more
information on
HidD_GetSerialNumberString
.