aboutsummaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorHenryk Plötz <henryk@ploetzli.ch>2010-03-03 04:23:25 +0100
committerHenryk Plötz <henryk@ploetzli.ch>2010-03-03 04:23:25 +0100
commit7bc2017424cebb7dd40aa091838dfccb1469e340 (patch)
treeccc86d377a8bedadb8aa6f9ab680ceee88ce3fa1 /utils.py
parent30828a01e8b623342f479cf668027ec141189ac4 (diff)
Implement InListPassiveTargets response parsing for ISO 14443 B
Implement PC/SC ATR generation for ISO 14443 B
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/utils.py b/utils.py
index c187892..89245d1 100644
--- a/utils.py
+++ b/utils.py
@@ -531,6 +531,7 @@ class PN532_Response(PN532_Frame):
class PN532_Target(object):
TYPE_ISO14443A = "ISO 14443-A"
+ TYPE_ISO14443B = "ISO 14443-B"
def __init__(self, type):
self.type = type
@@ -567,6 +568,20 @@ class PN532_Response_InListPassiveTarget(PN532_Response):
target.ats = []
# ATS length does count length byte
+ elif baudrate_polled == 3:
+ target = PN532_Target(PN532_Target.TYPE_ISO14443B)
+ self.targets[response[pos]] = target
+
+ target.atqb = response[(pos+1):(pos+13)]
+ pos = pos + 13
+
+ if response[pos] > 0:
+ target.attrib_res = response[pos+1:(pos+1+response[pos])]
+ pos = pos + response[pos]
+ else:
+ target.attrib_res = []
+ pos = pos + 1 # ATTRIB_RES length does not count the length byte
+
if last_pos == pos:
return False