tiny code cleanup

This commit is contained in:
2026-03-07 08:43:54 +11:00
parent 7aa331c6d4
commit b19ad3ce82
3 changed files with 25 additions and 34 deletions

View File

@@ -19,7 +19,7 @@ IRQ_GATTS_WRITE = const(3)
class BluetoothHandler:
def __init__(self):
print("initting bluetooth")
print("Initializing Bluetooth...")
self.ble = bluetooth.BLE()
self.ble.active(True)
self.ble.irq(self.irq)
@@ -31,12 +31,12 @@ class BluetoothHandler:
self.advertise()
def advertise(self):
print("advertising")
print("Advertising Bluetooth...")
# note: \x02\x01\x06\x0C\x09 is the BLE header that tells other devices we're BLE only and discoverable
self.ble.gap_advertise(100_000, b"\x02\x01\x06\x0C\x09MeshConnectorNode")
def irq(self, event, data):
print(f"IRQ | EVENT: {event}, DATA: {data}")
print(f"BLUETOOTH IRQ | EVENT: {event}, DATA: {data}")
if event == IRQ_CONNECT:
conn_handle, _, _ = data
self.connections.add(conn_handle)