aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-12-21 15:47:11 +1300
committerGitHub <noreply@github.com>2017-12-21 15:47:11 +1300
commit181d91bf2a7c86b443fcd14cf41a3aa6afe7e204 (patch)
treed5868331d98b31fb0c096a3a089b2cf3a2187f0d /src/org
parent49d36d2914e6662311d75f92ddd81372858fd658 (diff)
parentbac1fb563352b9908f12e7e021f4fc5b6242ee2a (diff)
downloadtrackermap-server-181d91bf2a7c86b443fcd14cf41a3aa6afe7e204.tar.gz
trackermap-server-181d91bf2a7c86b443fcd14cf41a3aa6afe7e204.tar.bz2
trackermap-server-181d91bf2a7c86b443fcd14cf41a3aa6afe7e204.zip
Merge pull request #3690 from nadezhdamosunova/master
din and dout parameters remastered
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/FlespiProtocolDecoder.java10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/FlespiProtocolDecoder.java b/src/org/traccar/protocol/FlespiProtocolDecoder.java
index e86a7c607..976746472 100644
--- a/src/org/traccar/protocol/FlespiProtocolDecoder.java
+++ b/src/org/traccar/protocol/FlespiProtocolDecoder.java
@@ -135,14 +135,8 @@ public class FlespiProtocolDecoder extends BaseHttpProtocolDecoder {
return true;
case "din":
case "dout":
- String key = name.equals("din") ? Position.KEY_INPUT : Position.KEY_OUTPUT;
- if (value == JsonValue.TRUE && index <= 32 && index >= 1) {
- if (position.getInteger(key) == 0) {
- position.set(key, 1 << (index - 1));
- } else {
- position.set(key, position.getInteger(key) | 1 << (index - 1));
- }
- }
+ position.set((name.equals("din") ? Position.KEY_INPUT : Position.KEY_OUTPUT),
+ ((JsonNumber) value).intValue());
return true;
case "gps.vehicle.mileage":
position.set(Position.KEY_ODOMETER, ((JsonNumber) value).doubleValue());