From b8b8b5f681459673fd7446b1e0eb8c903c958b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Mon, 4 Mar 2024 21:07:59 +0000 Subject: [PATCH] Huami: Display unknown raw activity kind in the activity summary --- .../gadgetbridge/devices/huami/HuamiActivitySummaryParser.java | 3 ++- 1 file changed, 2 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 5dcebf3a5..91d92d1f9 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 @@ -64,12 +64,13 @@ public class HuamiActivitySummaryParser implements ActivitySummaryParser { short version = buffer.getShort(); // version LOG.debug("Got sport summary version " + version + " total bytes=" + buffer.capacity()); int activityKind = ActivityKind.TYPE_UNKNOWN; + int rawKind = BLETypeConversions.toUnsigned(buffer.getShort()); try { - int rawKind = BLETypeConversions.toUnsigned(buffer.getShort()); HuamiSportsActivityType activityType = HuamiSportsActivityType.fromCode(rawKind); activityKind = activityType.toActivityKind(); } catch (Exception ex) { LOG.error("Error mapping activity kind: " + ex.getMessage(), ex); + addSummaryData("Raw Activity Kind", rawKind, UNIT_NONE); } summary.setActivityKind(activityKind);