aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/MiniFinderProtocolDecoder.java
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2021-12-27 18:22:07 -0600
committerIván Ávalos <avalos@disroot.org>2021-12-27 18:22:07 -0600
commitf03b999d6d17e53c1c1e1aa2f9271d03f12f2264 (patch)
treea16d409887e65e4211e0f8ea4fc73a86e637a032 /src/main/java/org/traccar/protocol/MiniFinderProtocolDecoder.java
parent3a528ddc88f72f39ff9566cf5e0f54938b1584ef (diff)
parent790db6295f130e64c8346f13985dd0c15f938b40 (diff)
downloadtraccar-server-f03b999d6d17e53c1c1e1aa2f9271d03f12f2264.tar.gz
traccar-server-f03b999d6d17e53c1c1e1aa2f9271d03f12f2264.tar.bz2
traccar-server-f03b999d6d17e53c1c1e1aa2f9271d03f12f2264.zip
Merge branch 'master' into suntech-fixes
Diffstat (limited to 'src/main/java/org/traccar/protocol/MiniFinderProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/MiniFinderProtocolDecoder.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/MiniFinderProtocolDecoder.java b/src/main/java/org/traccar/protocol/MiniFinderProtocolDecoder.java
index 2b7a960c4..d5be31cec 100644
--- a/src/main/java/org/traccar/protocol/MiniFinderProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/MiniFinderProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 - 2018 Anton Tananaev (anton@traccar.org)
+ * Copyright 2014 - 2021 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -143,7 +143,7 @@ public class MiniFinderProtocolDecoder extends BaseProtocolDecoder {
}
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress);
- if (deviceSession == null || !sentence.matches("![3A-D],.*")) {
+ if (deviceSession == null || !sentence.matches("![35A-D],.*")) {
return null;
}
@@ -161,6 +161,19 @@ public class MiniFinderProtocolDecoder extends BaseProtocolDecoder {
return position;
+ } else if (type.equals("5")) {
+
+ String[] values = sentence.split(",");
+
+ getLastLocation(position, null);
+
+ position.set(Position.KEY_RSSI, Integer.parseInt(values[1]));
+ if (values.length >= 4) {
+ position.set(Position.KEY_BATTERY_LEVEL, Integer.parseInt(values[3]));
+ }
+
+ return position;
+
} else if (type.equals("B") || type.equals("D")) {
Parser parser = new Parser(PATTERN_BD, sentence);