forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiscover_characteristics.py
More file actions
26 lines (20 loc) · 944 Bytes
/
Copy pathdiscover_characteristics.py
File metadata and controls
26 lines (20 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import asyncio
from bleak import BleakClient
OMI_MAC: str = "7F52EC55-50C9-D1B9-E8D7-19B83217C97D" # Replace with your actual MAC
async def main() -> None:
"""
Discover and display all Bluetooth services and characteristics for an Omi device.
Useful for debugging and understanding the device's Bluetooth interface.
"""
async with BleakClient(OMI_MAC) as client:
services = client.services
print("Listing all services and characteristics...\n")
for service in services:
print(f"[Service] {service.uuid} - {service.description}")
for char in service.characteristics:
print(f" [Characteristic] {char.uuid} - {char.description}")
print(f" Properties: {char.properties}")
if "notify" in char.properties:
print(" ✅ Notifiable (can stream data)")
if __name__ == "__main__":
asyncio.run(main())