mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-08-16 12:21:16 +02: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);
|
||||
} 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user