mirror of
https://github.com/brmlab/brmdoor_libnfc.git
synced 2025-06-08 16:36:25 +02:00
Make the UID read into infinite cycle
This commit is contained in:
parent
8869d25261
commit
23ae9ac77c
1 changed files with 9 additions and 8 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue