aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenryk Plötz <henryk@ploetzli.ch>2010-06-01 03:05:19 +0200
committerHenryk Plötz <henryk@ploetzli.ch>2010-06-01 03:05:19 +0200
commit59917271ddf84ed0d2c05041408b299f2634a488 (patch)
tree06b1b156b40e992c6f30967bcf850acdc4be809b
parent5baedf1e8eec4f08f7721b2f5272e6a2c912aec1 (diff)
Add Raw_APDU class for unparsed and nonjudgmental data transmission
-rw-r--r--utils.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/utils.py b/utils.py
index 51c139b..88905a1 100644
--- a/utils.py
+++ b/utils.py
@@ -458,6 +458,20 @@ class R_APDU(APDU):
"Return this APDU as a binary string"
return self.data + self.sw
+class Raw_APDU(APDU):
+ """Raw APDU that doesn't do any parsing"""
+
+ def parse(self, apdu):
+ "'Parse' the apdu and copy the values to this object"
+ self.data = apdu
+
+ def render(self):
+ "Return this APDU as a binary string"
+ return self.data
+
+ def _format_fields(self):
+ return ""
+
class PN532_Frame(APDU):
"""This is not really an ISO 7816 APDU, but close enough to use the same
class infrastructure."""