aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authornamo <namo@gurtam.com>2017-10-20 18:50:16 +0300
committernamo <namo@gurtam.com>2017-10-20 18:50:16 +0300
commitad8ee1702e02e02533e9f20e06af960b2cf3c647 (patch)
tree106cad3733014585424ae1dce0ab693ee02520f3 /src/org
parentcf1f0c95cb2f948abfffc5cb207926c916e636c0 (diff)
downloadtrackermap-server-ad8ee1702e02e02533e9f20e06af960b2cf3c647.tar.gz
trackermap-server-ad8ee1702e02e02533e9f20e06af960b2cf3c647.tar.bz2
trackermap-server-ad8ee1702e02e02533e9f20e06af960b2cf3c647.zip
flespi integration: listening messages (rev.5): unit test added
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/FlespiProtocolDecoder.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/FlespiProtocolDecoder.java b/src/org/traccar/protocol/FlespiProtocolDecoder.java
index 3a12cd7b8..69a977577 100644
--- a/src/org/traccar/protocol/FlespiProtocolDecoder.java
+++ b/src/org/traccar/protocol/FlespiProtocolDecoder.java
@@ -30,6 +30,7 @@ import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonNumber;
import javax.json.JsonObject;
+import javax.json.JsonString;
import java.io.StringReader;
import java.net.SocketAddress;
import java.nio.charset.StandardCharsets;
@@ -56,11 +57,11 @@ public class FlespiProtocolDecoder extends BaseProtocolDecoder {
List<Position> positions = new LinkedList<>();
for (int i = 0; i < result.size(); i++) {
JsonObject message = result.getJsonObject(i);
- String ident = message.getString("ident");
+ JsonString ident = message.getJsonString("ident");
if (ident == null) {
continue;
}
- DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, ident);
+ DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, ident.getString());
if (deviceSession == null) {
continue;
}