Bluetooth LE devices export battery status in a different way from "legacy" Bluetooth devices. That information is not visible from the kernel. BlueZ support for this is needed.
BlueZ support has been written: https://marc.info/?l=linux-bluetooth&m=150600624229315&w=2 We'll need to figure out how to implement this in UPower.
Created attachment 134952 [details] [review] linux: Add support for Bluetooth LE device batteries As exported through BlueZ's org.bluez.Battery1 D-Bus interface. This interface is only used for device where the battery information cannot be processed in the kernel. This is the first UpDevice type that doesn't use UdevDevice for the Linux backend, and it is also the first that does not poll() status at all.
Created attachment 134953 [details] [review] linux: Add test for Bluetooth LE battery support
Created attachment 135166 [details] [review] linux: Add support for Bluetooth LE device batteries As exported through BlueZ's org.bluez.Battery1 D-Bus interface. This interface is only used for device where the battery information cannot be processed in the kernel. This is the first UpDevice type that doesn't use UdevDevice for the Linux backend, and it is also the first that does not poll() status at all.
Created attachment 135167 [details] [review] linux: Add test for Bluetooth LE battery support
The second set of patches were updated to make use of a simpler BlueZ interface. Turns out one of the interfaces we implemented wasn't accepted or used, but still listed. The test suite passes as well.
Created attachment 135210 [details] [review] linux: Add support for Bluetooth LE device batteries As exported through BlueZ's org.bluez.Battery1 D-Bus interface. This interface is only used for device where the battery information cannot be processed in the kernel. This is the first UpDevice type that doesn't use UdevDevice for the Linux backend, and it is also the first that does not poll() status at all.
Created attachment 135211 [details] [review] linux: Add test for Bluetooth LE battery support
Attachment 135210 [details] pushed as ccb1b0e - linux: Add support for Bluetooth LE device batteries Attachment 135211 [details] pushed as 7771a57 - linux: Add test for Bluetooth LE battery support
*** Bug 99082 has been marked as a duplicate of this bug. ***
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.