mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-06-05 21:49:48 +02:00
Do something when we receive a CharacteristicChanged message
on the UUID_CHARACTERISTIC_BATTERY characteristic. This is a first try at addressing #71 Please note that this will probably not work at this point, but it's worth a try. To make it work probably we have to tell the device to send updates, and we don't know how to do it.
This commit is contained in:
committed by
cpfeiffer
parent
ea43d76705
commit
cb3be26349
@@ -415,7 +415,9 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
|||||||
UUID characteristicUUID = characteristic.getUuid();
|
UUID characteristicUUID = characteristic.getUuid();
|
||||||
if (MiBandService.UUID_CHARACTERISTIC_ACTIVITY_DATA.equals(characteristicUUID)) {
|
if (MiBandService.UUID_CHARACTERISTIC_ACTIVITY_DATA.equals(characteristicUUID)) {
|
||||||
handleActivityNotif(characteristic.getValue());
|
handleActivityNotif(characteristic.getValue());
|
||||||
}
|
} else if (MiBandService.UUID_CHARACTERISTIC_BATTERY.equals(characteristicUUID)) {
|
||||||
|
handleBatteryInfo(characteristic.getValue(), BluetoothGatt.GATT_SUCCESS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -641,4 +643,4 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
|||||||
protected TransactionBuilder createTransactionBuilder(String taskName) {
|
protected TransactionBuilder createTransactionBuilder(String taskName) {
|
||||||
return new MiBandTransactionBuilder(taskName);
|
return new MiBandTransactionBuilder(taskName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user