diff options
author | Henryk Plötz <henryk@ploetzli.ch> | 2010-03-03 01:38:53 +0100 |
---|---|---|
committer | Henryk Plötz <henryk@ploetzli.ch> | 2010-03-03 01:38:53 +0100 |
commit | da261b13328e7c2a14b8dcaca5974415be786b97 (patch) | |
tree | d07ffd95c17789f9b2a2b233ad81b634d2f11c43 /readers.py | |
parent | b27a1e034fd6124307ae69df31dfb8d96647ec27 (diff) |
Move InListPassiveTarget response parsing to PN532_Response_InListPassiveTarget class
Diffstat (limited to 'readers.py')
-rw-r--r-- | readers.py | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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() |