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.
master
Daniele Gobbetti 2015-06-16 17:03:35 +02:00 committed by cpfeiffer
parent ea43d76705
commit cb3be26349
1 changed files with 4 additions and 2 deletions

View File

@ -415,7 +415,9 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
UUID characteristicUUID = characteristic.getUuid();
if (MiBandService.UUID_CHARACTERISTIC_ACTIVITY_DATA.equals(characteristicUUID)) {
handleActivityNotif(characteristic.getValue());
}
} else if (MiBandService.UUID_CHARACTERISTIC_BATTERY.equals(characteristicUUID)) {
handleBatteryInfo(characteristic.getValue(), BluetoothGatt.GATT_SUCCESS);
}
}
@Override
@ -641,4 +643,4 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
protected TransactionBuilder createTransactionBuilder(String taskName) {
return new MiBandTransactionBuilder(taskName);
}
}
}