From 0b568df8debca9ea49c774b96664c71481543fd3 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Fri, 26 Feb 2016 00:04:33 +0100 Subject: [PATCH] Extra byte indeed appears to be heartrate value #205 --- .../devices/miband/operations/FetchActivityOperation.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/operations/FetchActivityOperation.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/operations/FetchActivityOperation.java index 9019013b4..6cefcef6e 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/operations/FetchActivityOperation.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/operations/FetchActivityOperation.java @@ -305,7 +305,7 @@ public class FetchActivityOperation extends AbstractMiBandOperation { } int bpm = getBytesPerMinuteOfActivityData(); LOG.debug("flushing activity data samples: " + activityStruct.activityDataHolderProgress / bpm); - byte category, intensity, steps; + byte category, intensity, steps, heartrate; DBHandler dbHandler = null; try { @@ -325,7 +325,9 @@ public class FetchActivityOperation extends AbstractMiBandOperation { category = activityStruct.activityDataHolder[i]; intensity = activityStruct.activityDataHolder[i + 1]; steps = activityStruct.activityDataHolder[i + 2]; - byte unknown = activityStruct.activityDataHolder[i + 3]; + if (hasExtendedActivityData) { + heartrate = activityStruct.activityDataHolder[i + 3]; + } samples[minutes] = new GBActivitySample( sampleProvider,