Make the UID read into infinite cycle

This commit is contained in:
Ondrej Mikle 2014-07-20 01:43:54 +02:00
parent 8869d25261
commit 23ae9ac77c

View file

@ -27,13 +27,14 @@ class NfcThread(threading.Thread):
stores it into uidQueue for later authentication check.
"""
self.nfc = NFCDevice()
try:
uid_hex = hexlify(self.nfc.scanUID())
print uid_hex
logging.info("Got UID %s" % uid_hex)
self.uidQueue.put(uid_hex)
except NFCError, e:
logging.warn("Failed to wait for RFID card", e)
while True:
try:
uid_hex = hexlify(self.nfc.scanUID())
print uid_hex
logging.info("Got UID %s" % uid_hex)
self.uidQueue.put(uid_hex)
except NFCError, e:
logging.warn("Failed to wait for RFID card", e)
class UnlockThread(threading.Thread):