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:
parent
66c1b3f178
commit
6f97b8c1e5
@ -725,6 +725,8 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
|||||||
handleBatteryInfo(characteristic.getValue(), status);
|
handleBatteryInfo(characteristic.getValue(), status);
|
||||||
} else if (MiBandService.UUID_CHARACTERISTIC_HEART_RATE_MEASUREMENT.equals(characteristicUUID)) {
|
} else if (MiBandService.UUID_CHARACTERISTIC_HEART_RATE_MEASUREMENT.equals(characteristicUUID)) {
|
||||||
logHeartrate(characteristic.getValue());
|
logHeartrate(characteristic.getValue());
|
||||||
|
} else if (MiBandService.UUID_CHARACTERISTIC_DATE_TIME.equals(characteristicUUID)) {
|
||||||
|
logDate(characteristic.getValue());
|
||||||
} else {
|
} else {
|
||||||
LOG.info("Unhandled characteristic read: " + characteristicUUID);
|
LOG.info("Unhandled characteristic read: " + characteristicUUID);
|
||||||
logMessageContent(characteristic.getValue());
|
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) {
|
public void logHeartrate(byte[] value) {
|
||||||
LOG.info("Got heartrate:");
|
LOG.info("Got heartrate:");
|
||||||
if (value.length == 2 && value[0] == 6) {
|
if (value.length == 2 && value[0] == 6) {
|
||||||
|
Loading…
Reference in New Issue
Block a user