1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 12:56:49 +01:00

Log the date that we receive from the Mi Band

This commit is contained in:
cpfeiffer 2016-03-31 21:54:09 +02:00
parent 66c1b3f178
commit 6f97b8c1e5

View File

@ -725,6 +725,8 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
handleBatteryInfo(characteristic.getValue(), status);
} else if (MiBandService.UUID_CHARACTERISTIC_HEART_RATE_MEASUREMENT.equals(characteristicUUID)) {
logHeartrate(characteristic.getValue());
} else if (MiBandService.UUID_CHARACTERISTIC_DATE_TIME.equals(characteristicUUID)) {
logDate(characteristic.getValue());
} else {
LOG.info("Unhandled characteristic read: " + characteristicUUID);
logMessageContent(characteristic.getValue());
@ -756,6 +758,11 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
}
}
public void logDate(byte[] value) {
GregorianCalendar calendar = MiBandDateConverter.rawBytesToCalendar(value);
LOG.info("Got Mi Band Date: " + DateTimeUtils.formatDateTime(calendar.getTime()));
}
public void logHeartrate(byte[] value) {
LOG.info("Got heartrate:");
if (value.length == 2 && value[0] == 6) {