examples/BLE Battery/README.md
This Serial Studio project visualizes the battery level from BLE devices (like iPhones) over Bluetooth Low Energy.
The project includes a control loop that selects the service and characteristic for you on connect.
Bluetooth Low Energy exposes battery level through the Battery Level characteristic, 0x2A19 (uint8, 0 to 100):
0x180A. This project is wired to the Device Information Service, where the test device (an iPhone) advertises its battery characteristic. Devices that follow the standard expose it under the Battery Service, 0x180F instead; change the service UUID in the control loop to match your hardware.0x2A19. Battery Level (uint8, 0 to 100).The bundled control loop picks the configured service, selects its first characteristic, subscribes to notifications (falling back to polling), and decodes the raw value with a 1-byte binary read.
| Setting | Value |
|---|---|
| Data Conversion | Binary (Direct) |
| Frame Detection | No Delimiters |
| Checksum | None |
| Dataset Index | 1 |
| Value Range | 0 to 100 |
| Widget | Gauge, Plot |
| Units | % |
| Title | Battery Level |
Parser:
/**
* @brief Converts a byte-like iterable into an array of numbers.
*
* @param frame An iterable containing byte values (0–255).
* @return Array of numeric byte values.
*/
function parse(frame) {
return Array.from(frame);
}
BLE Battery Level.ssproj.0x180A as shipped) and its battery characteristic (0x2A19) automatically.