Bluetooth speakers implementing the AVCRP protocol (which is most of them) can export battery information to the phone/computer they're attached to.
This requires changes in BlueZ to export that information.
The way to report battery status depends on the protocol used. We would probably
want to try to put all the code inside bluez itself so that we could reuse the
existing org.bluez.Battery1 interface, as propagated by UPower.
The hardest part of the work is figuring out whether a device advertises its
battery status at all, and then through which means. After that, implementing
the functionality should be fairly straight forward.
Through the AVRCP protocol, battery information is passed to bluez, however,
there seems to be nothing using that value, or exporting it. I also could not
find compatible hardware. Look for avrcp_handle_ct_battery_status()
2) HFP/HSP (3GPP variant)
In "3GPP TS 27.007, section 8", you'll find documentation for the
"+CIND" call (Indicator control), which can be used along with +CMER
to get notification events (unsolicited +CIEV result code) to get
the battery information.
An implementation exists in the android/ handsfree glue code in bluez.
3) HFP/HSP (Apple variant)
Example implementation inside PulseAudio:
4) HFP/HSP (Vendor specific)
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/upower/upower/issues/38.