How do I decode bytearray for power data #1579
-
DescriptionHi, from bleak import BleakClient
import asyncio
async def callback_data(sender, data):
print("Rohdaten:", data)
async def connect_and_data():
cyc_power_uuid = '00002a63-0000-1000-8000-00805f9b34fb'
address = 'C5:B3:F0:FB:9A:1E'
try:
async with BleakClient(address) as client:
await client.start_notify(cyc_power_uuid, callback_data)
await asyncio.sleep(10)
await client.stop_notify(cyc_power_uuid)
except Exception as e:
print(f"Fehler beim Verbinden oder Lesen: {e}")
except KeyboardInterrupt:
await client.stop_notify(cyc_power_uuid)
# Starte die asynchrone Funktion
asyncio.run(connect_and_data()) Output:
How do I decode this? PS: is there any chance of increasing the rate of data sent? Right now i get 1 Hz, but i try to reach around 5 Hz. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
You can find the representation of the data in the GATT Specification Supplement. Search for "Cycling Power Measurement" in the document. |
Beta Was this translation helpful? Give feedback.
-
It is up to the peripheral device. There isn't a standard way to do this that I know of. You could use the service explorer sample program to see if there are any custom characteristics that seem like they might allow changing the rate. But if not, there might not be a way to change it. |
Beta Was this translation helpful? Give feedback.
You can find the representation of the data in the GATT Specification Supplement. Search for "Cycling Power Measurement" in the document.