-
Notifications
You must be signed in to change notification settings - Fork 467
Description
Hello,
I built libnfc on Windows and tried to read Mifare Classic tag.
The library prints this message:
"Type of target not supported"
I looked at the code, and I think the problem is with the pcsc_get_icc_type function. It calls SCardGetAttrib() with SCARD_ATTR_ICC_TYPE_PER_ATR. According to the current documentation for SCardGetAttrib() and SCARD_ATTR_ICC_TYPE_PER_ATR can be one:
Single byte indicating smart card type:
0 = unknown type
1 = 7816 Asynchronous
2 = 7816 Synchronous
[https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetattrib](SCardGetAttrib() documentation)
The pcsc driver expects one of the following types:
#define ICC_TYPE_UNKNOWN 0
#define ICC_TYPE_14443A 5
#define ICC_TYPE_14443B 6
In my case, SCardGetAttrib() returns 1 for SCARD_ATTR_ICC_TYPE_PER_ATR, for the sample tag I use.
It looks like there is some disconnect between the pcsc driver and the MS SCard API. Or am I doing something incorrectly?