feat: boot manager, provisioning server, node stubs v0.3.0
This commit is contained in:
29
node_access_control.py
Normal file
29
node_access_control.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# ============================================================+
|
||||
# Identity IoT — Node: Access Control
|
||||
# (c) Copyright : ae Aeonian Engineering Limited - Hong Kong
|
||||
# (c) Copyright : WIDE di D. Papa - Naples - Italy
|
||||
# ============================================================+
|
||||
# Reads NTAG424 badge via PN532, performs challenge/verify
|
||||
# against identity_tag backend.
|
||||
# ============================================================+
|
||||
|
||||
import utime
|
||||
|
||||
|
||||
def run_access_control(cfg, caps):
|
||||
"""Main loop for access_control node type. Called from boot_manager."""
|
||||
print('[access_control] starting — NFC:', caps.get('has_nfc'))
|
||||
|
||||
if not caps.get('has_nfc'):
|
||||
print('[access_control] ERROR: no NFC hardware detected')
|
||||
return
|
||||
|
||||
# TODO: init PN532
|
||||
# TODO: wait for badge tap
|
||||
# TODO: read UID from NTAG424
|
||||
# TODO: challenge/verify against cfg['base_url']
|
||||
# TODO: trigger relay on success if has_relay
|
||||
|
||||
while True:
|
||||
print('[access_control] waiting for badge...')
|
||||
utime.sleep(2)
|
||||
Reference in New Issue
Block a user