Skip to content

Commit

Permalink
Merge pull request #27 from vitorio/master
Browse files Browse the repository at this point in the history
ATQA and SAK reporting for ISO14443A and JEWEL in LIBNFC
Thanks for the input!
  • Loading branch information
AdamLaurie committed Aug 7, 2017
2 parents ee89b09 + 85c9dbb commit f4b5582
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion rfidiot/pynfc.py
Expand Up @@ -236,9 +236,11 @@ def __init__(self, ti):
self.atr = "".join(["%02X" % x for x in ti.abtAts[:ti.uiAtsLen]])
else:
self.atr = ""
self.atqa = "".join(["%02X" % x for x in ti.abtAtqa])
self.sak = "%02X" % ti.btSak

def __str__(self):
rv = "ISO14443A(uid='%s', atr='%s')" % (self.uid, self.atr)
rv = "ISO14443A(uid='%s', atr='%s', atqa='%s', sak='%s')" % (self.uid, self.atr, self.atqa, self.sak)
return rv

class ISO14443B(object):
Expand All @@ -259,6 +261,8 @@ def __init__(self, ti):
self.btId = "".join(["%02X" % x for x in ti.btId[:4]])
self.uid = self.btId
self.atr = "" # idem
self.atqa = self.btSensRes
self.sak = ""

def __str__(self):
rv = "JEWEL(btSensRes='%s', btId='%s')" % (self.btSensRes, self.btId)
Expand Down Expand Up @@ -490,6 +494,8 @@ def sendAPDU(self, apdu):
c = n.readISO14443A()
print 'UID: ' + c.uid
print 'ATR: ' + c.atr
print 'ATQA: ' + c.atqa
print 'SAK: ' + c.sak

cont = True
while cont:
Expand Down

0 comments on commit f4b5582

Please sign in to comment.