From eafe26117e9cc52c58f4ce220f8ac0d5e1d9bf36 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 1 Oct 2021 20:22:21 -0700 Subject: Fix Bluetooth decoding --- src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java index bee21982e..0e829e7f7 100644 --- a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java @@ -461,9 +461,11 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder { position.setDeviceId(deviceSession.getDeviceId()); position.set(Position.KEY_TYPE, type); - int mask = Integer.parseInt(values[index++], 16); + int mask; if (type.equals("BLE")) { mask = 0b1100000110110; + } else { + mask = Integer.parseInt(values[index++], 16); } if (BitUtil.check(mask, 1)) { @@ -518,7 +520,6 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder { position.setValid(true); int count = Integer.parseInt(values[index++]); - index += 1; for (int i = 1; i <= count; i++) { position.set("tag" + i + "Rssi", Integer.parseInt(values[index++])); -- cgit v1.2.3