aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java b/src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java
index 83ca74ce5..6e6f9c700 100644
--- a/src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 - 2020 Anton Tananaev (anton@traccar.org)
+ * Copyright 2017 - 2022 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.
@@ -19,7 +19,7 @@ import io.netty.channel.Channel;
import io.netty.handler.codec.http.FullHttpRequest;
import io.netty.handler.codec.http.HttpResponseStatus;
import org.traccar.BaseHttpProtocolDecoder;
-import org.traccar.DeviceSession;
+import org.traccar.session.DeviceSession;
import org.traccar.Protocol;
import org.traccar.helper.UnitsConverter;
import org.traccar.model.Position;
@@ -54,11 +54,11 @@ public class FlespiProtocolDecoder extends BaseHttpProtocolDecoder {
List<Position> positions = new LinkedList<>();
for (int i = 0; i < result.size(); i++) {
JsonObject message = result.getJsonObject(i);
- JsonString ident = message.getJsonString("ident");
- if (ident == null) {
+ JsonString identifier = message.getJsonString("ident");
+ if (identifier == null) {
continue;
}
- DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, ident.getString());
+ DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, identifier.getString());
if (deviceSession == null) {
continue;
}
@@ -228,6 +228,15 @@ public class FlespiProtocolDecoder extends BaseHttpProtocolDecoder {
position.set(Position.KEY_ALARM, Position.ALARM_BONNET);
}
return true;
+ case "custom.wln_accel_max":
+ position.set("maxAcceleration", ((JsonNumber) value).doubleValue());
+ return true;
+ case "custom.wln_brk_max":
+ position.set("maxBraking", ((JsonNumber) value).doubleValue());
+ return true;
+ case "custom.wln_crn_max":
+ position.set("maxCornering", ((JsonNumber) value).doubleValue());
+ return true;
default:
return false;
}