0

Is it possible to detect when there are multiple smartcards in a smartcard reader through WinSCard api? I'm reading card ids, but when there are multiple cards, it becomes ambiguous, which one should be returned. So I'd like to forbid such case and return an error message.

eko
  • 369
  • 4
  • 15

2 Answers2

0

If there are multiple cards i.e. multiple readers are using. Here winscard API function - SCardListReadersA() will return the name of reader/s attached to the system like,

 if one reader then "one reader"NULL|NULL|garbage
 if two reader then "one reader"NULL"second reader"NULL|NULL|garbage

when you connect to the reader you need to pass the reader name in function - SCardConnectA() and response (ID) you are getting with function SCardTransmit() is from the reader and card which you connect with using function SCardConnectA().

hope this information will help.

Arjun
  • 3,491
  • 4
  • 25
  • 47
  • Thanks for the reply. I'm only using one card reader, and I'd like to prevent reading card id when there are more than one card in the reader. – eko Jul 26 '16 at 09:42
  • multiple card in a single reader!!! Is the reader have more that one chip station? or its is hybrid reader ( contact + contactless) – Arjun Jul 27 '16 at 04:58
  • No, it only supports reading one card at a time and only contactless cards. The reader model is acr-1252. – eko Jul 27 '16 at 07:40
0

ACR-1252 reader has only one contact-less interface. When you try to connect (lay on) two contact-less smartcards at the same time, it becomes the responsibility of the reader firmware to choose which one will be connected to its slot. Some reader vendors allow you to configure their firmware to behave differently in such cases. I don't know whether your reader has such capability, but I highly doubt it.

arminb
  • 2,036
  • 3
  • 24
  • 43