From 9ee5a8a9f085ca8faa101c06d26955585ded8ed3 Mon Sep 17 00:00:00 2001 From: Eggman20339 Date: Sun, 5 May 2024 19:58:51 -0400 Subject: [PATCH] changes --- main.py | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index 38ed896..2b7ff23 100644 --- a/main.py +++ b/main.py @@ -46,8 +46,14 @@ from fido2.ctap2 import Ctap2 gotAaguid = None GPIO.setmode(GPIO.BCM) -GPIO.setup(14, GPIO.OUT) -GPIO.output(14, GPIO.LOW) + +greenLed = 14 +redLed = 4 + +GPIO.setup(greenLed, GPIO.OUT) +GPIO.output(greenLed, GPIO.LOW) +GPIO.setup(redLed, GPIO.OUT) +GPIO.output(redLed, GPIO.LOW) class CliInteraction(UserInteraction): def prompt_up(self): print("\nTouch your authenticator device now...\n") @@ -63,10 +69,10 @@ def badCred(): print("Bad credential!") time.sleep(2) while True: - GPIO.output(14, GPIO.LOW) + # GPIO.output(14, GPIO.LOW) print("Waiting for device...") while True: - GPIO.output(14, GPIO.LOW) + # GPIO.output(14, GPIO.LOW) dev = next(CtapHidDevice.list_devices(), None) if dev: @@ -186,16 +192,20 @@ while True: print("Credential authenticated!") for i in range(5): - GPIO.output(14, GPIO.HIGH) + GPIO.output(greenLed, GPIO.HIGH) time.sleep(0.05) - GPIO.output(14, GPIO.LOW) + GPIO.output(greenLed, GPIO.LOW) time.sleep(0.05) print("CLIENT DATA:", result.client_data) print() print("AUTH DATA:", result.authenticator_data) - GPIO.output(14, GPIO.LOW) + # GPIO.output(14, GPIO.LOW) time.sleep(1) except Exception as e: - GPIO.output(14, GPIO.LOW) - print("Authentication Failed!") \ No newline at end of file + print("Authentication Failed!") + for i in range(5): + GPIO.output(redLed, GPIO.HIGH) + time.sleep(0.05) + GPIO.output(redLed, GPIO.LOW) + time.sleep(0.05)