From eabd40db41761a98837b7f90ae6c40239758eb10 Mon Sep 17 00:00:00 2001 From: EggMan20339 <99349302+EggMan20339@users.noreply.github.com> Date: Thu, 9 May 2024 22:34:53 -0400 Subject: [PATCH] more nfc --- main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 8c763b1..6eb73c7 100644 --- a/main.py +++ b/main.py @@ -33,7 +33,7 @@ On Windows, the native WebAuthn API will be used. """ import time import configparser -gpie = True +gpie = False if gpie: import RPi.GPIO as GPIO import pickle @@ -54,7 +54,7 @@ config = configparser.ConfigParser() config.read('config.ini') -nfc = False +isNfc = False dbusername = config.get('Setup', 'dbusername') dbpassword = config.get('Setup', 'dbpassword') @@ -110,10 +110,10 @@ class CliInteraction(UserInteraction): print("User Verification required.") return True -clf = nfc.ContactlessFrontend('usb') def read_nfc_tag(): clf = None try: + clf = nfc.ContactlessFrontend('usb') tag = clf.connect(rdwr={'on-connect': lambda tag: False}) nfc = True return tag.identifier if tag else None @@ -126,7 +126,7 @@ def read_nfc_tag(): pass while True: - nfc = False + isNfc = False if gpie: GPIO.output(door, GPIO.LOW) @@ -247,7 +247,7 @@ while True: request_options, state = server.authenticate_begin(credentials, user_verification=uv) # Authenticate the credential - if not nfc: + if not isNfc: result = client.get_assertion(request_options["publicKey"]) else: sendme = cbor.encode(credentials)