Hey guys I came to across with RF reader FEIG CPRG40.30-USB and that fucker is responding for RF REQA cmd ([0xFF, 0x96, 0x01, 0x00, 0x00]) only by "0x1C" which is completely non standard answer - as everything in RFID readers... But since I can not change FEIG reader please change your library in this way:
smartcard/pcsc/PCSCCardConnection.py: line 177:
sw1 = (response[-2] + 256) % 256
sw2 = (response[-1] + 256) % 256
data = map(lambda x: (x + 256) % 256, response[:-2])
change to:
if(len(response)>1):
sw1 = (response[-2] + 256) % 256
else:
sw1 = 0x00
sw2 = (response[-1] + 256) % 256
if(len(response)>1):
data = map(lambda x: (x + 256) % 256, response[:-2])
else:
data = []
thanks for pointing out this non-standard reader behaviour. Looking for the implication of your proposal, and eventual alternate workarounds. will keep you posted.
Hello,
Please check again using the latest PySCard version 1.9.2 (or more) and open a new bug if you still have the problem.