1
votes

I have multiple ACR122T smart card devices with no unique serial numbers (from ACS). I need to know which physical smart card I am connected to from within pcsc-lite. I know from using lsusb which USB Port a physical device is on, but how to map that USB port information with SCardGetAttribute(SCARD_ATTR_DEVICE_UNIT) ?

It seems the map should be at the OS level as I cant find a way to read USB Port info (lsusb results) from within the pscs-lite API.

This post mentions a method, Smartcard reader ACR122U has no unique serial number but I dont understand the details behind "used that dev number to ensure I always used the right reader".

Any help appreciated. Thanks, -Phil

1

1 Answers

0
votes

Disclaimer: I'm working on Windows, not Linux.

The ACR122T (and ACR122U) devices not only have no serial number (other than the one printed on the back) but also have no USB serial number so that they can only be differentiated by the USB port they are plugged in. Additionally all the ACR122Ts and Us I have here (we bought a bunch) identify themselves as "ACS ACR122" to Windows. Using the proprietary API to get the firmware version both the ACR122T and the ACR122U identify themselves as a ACR122U (e.g. "ACR122U207" or "ACR122U214").

That means that the OS itself is not able to differentiate multiple devices in any other way then the USB port it's plugged in.

I also tried to make a connection between the pcsc device and the OS device, but apart from this function (which is only available starting Windows 8) I have not found anything, so it looks to me like there is no way to do that through pcsc calls.

The device unit is given out by the pcsc layer sequentially so you can differentiate between devices you are connected to but not identify a specific device.