trying SCRIPTIS but debugger is flaky so VS Code got the shot once again.
error = ProxiLAB.Reader.ISO14443.SendTclCommand(0x00, 0x00, TxBuffer, RxBuffer)
if (error[0]):
print("Tcl: {0}".format(ProxiLAB.GetErrorInfo(error[0])))
PopMsg += "Tcl: {0}".format(ProxiLAB.GetErrorInfo(error[0])) + "\n"
else:
print("Tcl response: " + ''.join(["0x%02X " % x for x in RxBuffer.value]))
PopMsg += "Tcl response: " + ''.join(["0x%02X " % x for x in RxBuffer.value]) + "\n"
def inventory_iso14443A(self):
"""
By sending a 0xA0 command to the EVM module, the module will carry out
the whole ISO14443 anti-collision procedure and return the tags found.
>>> Req type A (0x26)
<<< ATQA (0x04 0x00)
>>> Select all (0x93, 0x20)
<<< UID + BCC
"""
response = self.issue_evm_command(cmd='A0')
for itm in response:
iba = bytearray.fromhex(itm)
# Assume 4-byte UID + 1 byte Block Check Character (BCC)
if len(iba) != 5:
logger.warn('Encountered tag with UID of unknown length')
continue
if iba[0] ^ iba[1] ^ iba[2] ^ iba[3] ^ iba[4] != 0:
logger.warn('BCC check failed for tag')
continue
uid = itm[:8] # hex string, so each byte is two chars
logger.debug('Found tag: %s (%s) ', uid, itm[8:])
yield uid
# See https://github.com/nfc-tools/libnfc/blob/master/examples/nfc-anticol.c