refactor: implement packet parsing heuristics and introduce device-level state caching to throttle database writes and vitals updates
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import sqlite3
|
||||
|
||||
def main():
|
||||
conn = sqlite3.connect("hl7_forwarder.db")
|
||||
cursor = conn.cursor()
|
||||
try:
|
||||
cursor.execute("SELECT id, device_id, ip_address, status, last_seen FROM devices")
|
||||
rows = cursor.fetchall()
|
||||
print("=== Registered Devices ===")
|
||||
for row in rows:
|
||||
print(f"ID: {row[0]} | Device ID: {row[1]} | IP: {row[2]} | Status: {row[3]} | Last Seen: {row[4]}")
|
||||
except Exception as e:
|
||||
print("Error:", e)
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user