06 · Bluetooth battery — sources, authorization, and cache

06 · Bluetooth battery — sources, authorization, and cache An architecture diagram generated by Archify. Connected device · Normalize address · Architecture component Connected device Normalize address HID BatteryPercent · One valid value? · Architecture component HID BatteryPercent One valid value? Display battery · 0 to 100 percent · Architecture component Display battery 0 to 100 percent BLE assignment · UUID + address in the same record · Architecture component BLE assignment UUID + address in the same record Query allowed? · Authorized, connected, ≥ 5 min · Architecture component Query allowed? Authorized, connected, ≥ 5 min Read GATT · 180F → 2A19; timeout 10 s · Architecture component Read GATT 180F → 2A19; timeout 10 s RAM cache · Valid value, at most 15 min · Architecture component RAM cache Valid value, at most 15 min Registry valid value UUID + address unambiguous already authorized value / error Legend Backend

Existing connections only

  • • No scan, pairing, or name matching.
  • • The BLE identity must belong to the connected device.

No additional battery permission

  • • CBManager.authorization must already be allowedAlways.
  • • GATT: at least 5 min apart, 10 s timeout, 15 min cache.

Unknown remains invisible

  • • Battery display reads the HID value, otherwise a fresh RAM cache.
  • • onChange updates the device row; errors clear the cached value.