Closed domi007 closed 3 years ago
Thanks for the PR Domi. Could you please provide me few examples of reader arguments ? Just for curiosity.
Sure thing Benoit. The reader argument is the name of the reader, as reported by pcscd. This is widely used as a reference to each reader (instead of e.g. USB device ID or something else).
# pcsc_scan
PC/SC device scanner
V 1.5.2 (c) 2001-2017, Ludovic Rousseau <ludovic.rousseau@free.fr>
Using reader plug'n play mechanism
Scanning present readers...
0: VMware Virtual USB CCID 00 00
1: VMware Virtual USB CCID 00 01
Example:
from card.USIM import *
from smartcard.System import readers
for r in readers():
u = USIM(reader=str(r))
print("IMSI:", u.get_imsi(), "(reader:", str(r), ")")
Output:
IMSI: XXX (reader: VMware Virtual USB CCID 00 00 )
IMSI: YYY (reader: VMware Virtual USB CCID 01 00 )
Maybe it's coming late, but better late than never :) Commit https://github.com/mitshell/card/commit/f68ccd98386395eb2784a4b71f8ff4b3d03046b7 enables to pass a smartcard reader name in every class constructors: that should address your case !
It could be very useful in an environment with multiple cards connected to a single machine to be able to exactly specify the name of the reader to use instead of relying on possibly random selection. The change introduced keeps backward-compatibility via default empty parameters.