bluetooth: Register as BlueZ experimental BatteryProvider1

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/482>
This commit is contained in:
Marijn Suijten 2021-01-18 11:04:43 +01:00
parent c667befe9a
commit f7955eeb48
3 changed files with 236 additions and 3 deletions

View file

@ -769,7 +769,7 @@ static void rfcomm_io_callback(pa_mainloop_api *io, pa_io_event *e, int fd, pa_i
switch (key) {
case 1:
pa_log_notice("Battery Level: %d0%%", val + 1);
pa_bluetooth_device_report_battery_level(t->device, (val + 1) * 10);
pa_bluetooth_device_report_battery_level(t->device, (val + 1) * 10, "Apple accessory indication");
break;
case 2:
pa_log_notice("Dock Status: %s", val ? "docked" : "undocked");