From 645c22b10a82a6c9b4da5e6fb086404fdb8e7b94 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sat, 22 Aug 2020 21:59:18 +0200 Subject: [PATCH] Huami: decode average HR where available (newer devices) --- .../devices/huami/HuamiActivitySummaryParser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/HuamiActivitySummaryParser.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/HuamiActivitySummaryParser.java index 8b905f3ce..2e2a00fd7 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/HuamiActivitySummaryParser.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/HuamiActivitySummaryParser.java @@ -101,6 +101,7 @@ public class HuamiActivitySummaryParser implements ActivitySummaryParser { float totalStride = 0; float averageStride; short averageHR; + short maxHR = 0; short averageKMPaceSeconds; int ascentSeconds = 0; int descentSeconds = 0; @@ -144,7 +145,7 @@ public class HuamiActivitySummaryParser implements ActivitySummaryParser { averageHR = buffer.getShort(); averageKMPaceSeconds = buffer.getShort(); averageStride = buffer.getShort(); - buffer.getShort(); // unknown + maxHR = buffer.getShort(); if (activityKind == ActivityKind.TYPE_CYCLING || activityKind == ActivityKind.TYPE_RUNNING) { // this had nonsense data with treadmill on bip s, need to test it with running @@ -284,6 +285,7 @@ public class HuamiActivitySummaryParser implements ActivitySummaryParser { addSummaryData("maxPace", maxPace, "seconds_m"); addSummaryData("totalStride", totalStride, "meters"); addSummaryData("averageHR", averageHR, "bpm"); + addSummaryData("maxHR", maxHR, "bpm"); addSummaryData("averageKMPaceSeconds", averageKMPaceSeconds, "seconds_km"); addSummaryData("averageStride", averageStride, "cm");