BLE device battery service

I'm devloping an iOS App for the Polar H7 and H10 Heart Rate sensors and it's crucial that the App monitors the attached device's battery level.

For ayone who needs to get the battery level from a BLE device (if it supports such), the Battery Service UUID is 0x180F and the battery level characterisitc UUID is 0x2A19, reporting a one byte value with the battery level as a percentage (UInt8). Details are at https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.battery_service.xml


In my Swift 3 code, having discovered the Service and the Characteristic (2A19), I do a peripheral.readValue(for: battChar) then a peripheral.setNotifyValue(true, for: battChar). The value is then provided in the didupdatevalue for characterisitc function. Not surprisingly, my Polar devices do not constantly update the battery status but must be interrogated from time to time using the peripheral.readvalue(for: ...) function.


I hope this helps someone, somewhere, sometime. 🙂

Post not yet marked as solved Up vote post of AncientCoder Down vote post of AncientCoder
6.8k views
  • Thanks a lot. That's exactly what I have been looking for. Updated link : https://www.bluetooth.com/specifications/specs/battery-service/

Add a Comment

Replies

It did! Thanks

Your post gives me tons of help. Thanks.