From e124ac4974191901ff5e155c79ae49ebd0aea37f Mon Sep 17 00:00:00 2001 From: Me7c7 Date: Fri, 25 Oct 2024 10:00:00 +0300 Subject: [PATCH] Huawei: fix Send thresholds packet --- .../gadgetbridge/devices/huawei/packets/FitnessData.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/packets/FitnessData.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/packets/FitnessData.java index 3606aba3a..5a3d52890 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/packets/FitnessData.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/packets/FitnessData.java @@ -477,10 +477,12 @@ public class FitnessData { this.serviceId = FitnessData.id; this.commandId = id; - this.tlv = new HuaweiTLV(); + + HuaweiTLV subTlv = new HuaweiTLV(); for(HuaweiReportThreshold th: thresholds) { - this.tlv.put(0x02, th.getBytes()); + subTlv.put(0x02, th.getBytes()); } + this.tlv = new HuaweiTLV().put(0x81, subTlv); this.complete = true; } }