我对如何阅读Android设备的电池电量感到有些困惑。我能够很好地获得BluetoothGattCharacteristic
电池电量,但结果看起来很奇怪。
我基本上做了以下事情:
int batteryLevel = characteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_UINT8, 0);
然后返回值57.这看起来不错,但是当我使用其他蓝牙应用程序(如Bluepixel的BLE扫描仪)进行测试时,该应用程序总是会报告大约17%的值。
我能做错什么会给我一个不同的数字?