Check battery level of connected bluetooth device on linux

后端 未结 9 1760
盖世英雄少女心
盖世英雄少女心 2021-01-30 02:09

How can I check the battery level of a connected bluetooth device? The device shows the battery level on Android so I\'m assuming the device supports the GATT-based Battery Serv

9条回答
  •  -上瘾入骨i
    2021-01-30 02:59

    By default Bluez 'hides' the Battery Service UUID. This is because there is a 'battery plugin' loaded at startup of bluetoothd.

    If you don't want the battery plugin to be activated and make the Battery Service UUID visible again to bluetoothctl or any other application, then change the startup command for bluetoothd to be like this: 'bluetoothd -P battery'. That will make sure the battery plugin is not loaded. On a Raspberry Pi the bluetooth.service is located in /lib/systemd/system/bluetooth.service so you need to make the change in that file.

提交回复
热议问题