From 89a3fcc9206c8650fcbbb670895995cf67ea726f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Sun, 21 Jul 2024 11:53:05 +0100 Subject: [PATCH] CMF Watch Pro: Fix serial number truncating last 2 digits --- .../service/devices/cmfwatchpro/CmfWatchProSupport.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/cmfwatchpro/CmfWatchProSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/cmfwatchpro/CmfWatchProSupport.java index 2f726845b..576c92444 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/cmfwatchpro/CmfWatchProSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/cmfwatchpro/CmfWatchProSupport.java @@ -296,7 +296,7 @@ public class CmfWatchProSupport extends AbstractBTLEDeviceSupport implements Cmf LOG.warn("Unexpected serial number payload length: {}, expected {}", payload.length, (payload[0] & 0xff)); return; } - final String serialNumber = new String(ArrayUtils.subarray(payload, 1, payload.length - 2)); + final String serialNumber = new String(ArrayUtils.subarray(payload, 1, payload.length)); LOG.debug("Got serial number: {}", serialNumber); final GBDeviceEventUpdateDeviceInfo gbDeviceEventUpdateDeviceInfo = new GBDeviceEventUpdateDeviceInfo("SERIAL: ", serialNumber); evaluateGBDeviceEvent(gbDeviceEventUpdateDeviceInfo);