aboutsummaryrefslogtreecommitdiffstats
path: root/readers.py
diff options
context:
space:
mode:
authorHenryk Plötz <henryk@ploetzli.ch>2010-03-03 01:38:53 +0100
committerHenryk Plötz <henryk@ploetzli.ch>2010-03-03 01:38:53 +0100
commitda261b13328e7c2a14b8dcaca5974415be786b97 (patch)
treed07ffd95c17789f9b2a2b233ad81b634d2f11c43 /readers.py
parentb27a1e034fd6124307ae69df31dfb8d96647ec27 (diff)
Move InListPassiveTarget response parsing to PN532_Response_InListPassiveTarget class
Diffstat (limited to 'readers.py')
-rw-r--r--readers.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/readers.py b/readers.py
index af95990..c06c049 100644
--- a/readers.py
+++ b/readers.py
@@ -162,17 +162,17 @@ class ACR122_Reader(Smartcard_Reader):
return "".join(response[:-2])
def pn532_acquire_card(self):
- response = self.pn532_transceive("\xd4\x04")
- if ord(response[4]) > 0:
+ # Turn antenna power off and on to forcefully reinitialize the card
+ self.pn532_transceive("\xd4\x32\x01\x00")
+ self.pn532_transceive("\xd4\x32\x01\x01")
+
+ response = self.pn532_transceive("\xd4\x4a\x01\x00")
+ if ord(response[2]) > 0:
return True
else:
- response = self.pn532_transceive("\xd4\x4a\x01\x00")
+ response = self.pn532_transceive("\xd4\x4a\x01\x03\x00")
if ord(response[2]) > 0:
return True
- else:
- response = self.pn532_transceive("\xd4\x4a\x01\x03\x00")
- if ord(response[2]) > 0:
- return True
def _internal_connect(self):
self._parent.connect()