Good day! Cant get battery percentage in percent. I
ve successfully connected to GATT services, thed did this:
public override void OnServicesDiscovered(BluetoothGatt Gatt, [GeneratedEnum] GattStatus Status)
{
base.OnServicesDiscovered(Gatt, Status);
if (Status == GattStatus.Success)
{
if(Service.Uuid.Equals(UUID.FromString("0000180f-0000-1000-8000-00805f9b34fb")))
{
BluetoothGattCharacteristic characteristic = Service.GetCharacteristic(UUID.FromString("00002a19-0000-1000-8000-00805f9b34fb"));
if(characteristic!=null)
{
Gatt.ReadCharacteristic(characteristic);
}
}
}
}
else
{
MainActivity.AppendLog("onServicesDiscovered received: " + Status);
}
}
Then, on Read
public override void OnCharacteristicRead(BluetoothGatt Gatt, BluetoothGattCharacteristic Characteristic, [GeneratedEnum] GattStatus Status)
{
base.OnCharacteristicRead(Gatt, Characteristic, Status);
var batteryData = Characteristic.GetValue();
}
I got only 77 and this is not a battery percentage (0-64). Device always send this number, I tried to charge device and wait for low level battery, but got always this. Thanks for a help.