I decided to build a tool to display the battery level of a pair of Bluetooth headphones, since I got this feature on Android, but not on Windows. For some reason, it just doesn't display in the settings. I'm using UWP and with the Device Enumerator I managed to pull a list of connected devices. Is there any way to get the battery level from this point? I've seen that people are using RFCom or GATT, but their issue involves connecting to the device, which I think is redundant since the tool is supposed to work on already connected devices.
Get Bluetooth Device Battery Level
Asked Answered
You must connect to Battery Service (BLE GATT service) to be able to read and notified about batt level information. No other way to do that. Of course, if that is BLE device. it is is Classic Bluetooth device than you have to connec to its RFCOMM control channel (for HandsFree) or use L2CAP (not available on Windows) to read information from Audio service channel 9for A2DP device). –
Hesperian
I think it's a BLE. Cause since I've used them Microsoft BLE is listed in Device Manager. –
Serbocroatian
It is always listed there if your Bluetooth dongle supports BLE features. It is just a BLE driver. –
Hesperian
My bad then, didn't notice it as I haven't been so much interested in this domain. –
Serbocroatian
I enumerated the bluetooth device and checked its properties but didn't find the relevant power information, so currently, there is no method can get the battery level. –
Troy
I have no experience in this field. Never worked with Bluetooth devices. I searched Google (obviously) for this, but any answers were for totally different issues. –
Serbocroatian
Currently there is no api can directly get the battery level of your bluetooth devices in uwp. –
Troy
Oh, ok. Thank you. –
Serbocroatian
© 2022 - 2024 — McMap. All rights reserved.