aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-10-01 20:22:21 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-10-01 20:22:21 -0700
commiteafe26117e9cc52c58f4ce220f8ac0d5e1d9bf36 (patch)
tree348aae1f8a6aae1930b6953d2875ab1aeef9941b /src/main/java/org/traccar
parentc1b406b6fcc442f96f9698774f5544ec9a0588e9 (diff)
downloadtrackermap-server-eafe26117e9cc52c58f4ce220f8ac0d5e1d9bf36.tar.gz
trackermap-server-eafe26117e9cc52c58f4ce220f8ac0d5e1d9bf36.tar.bz2
trackermap-server-eafe26117e9cc52c58f4ce220f8ac0d5e1d9bf36.zip
Fix Bluetooth decoding
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java5
1 files changed, 3 insertions, 2 deletions
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++]));