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,14 +27,15 @@ class NfcThread(threading.Thread):
stores it into uidQueue for later authentication check. stores it into uidQueue for later authentication check.
""" """
self.nfc = NFCDevice() self.nfc = NFCDevice()
try: while True:
uid_hex = hexlify(self.nfc.scanUID()) try:
print uid_hex uid_hex = hexlify(self.nfc.scanUID())
logging.info("Got UID %s" % uid_hex) print uid_hex
self.uidQueue.put(uid_hex) logging.info("Got UID %s" % uid_hex)
except NFCError, e: self.uidQueue.put(uid_hex)
logging.warn("Failed to wait for RFID card", e) except NFCError, e:
logging.warn("Failed to wait for RFID card", e)
class UnlockThread(threading.Thread): class UnlockThread(threading.Thread):
"""Thread checking UIDs whether they are authorized""" """Thread checking UIDs whether they are authorized"""