aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornamo <namo@gurtam.com>2017-12-20 17:37:06 +0300
committernamo <namo@gurtam.com>2017-12-20 17:37:06 +0300
commitbac1fb563352b9908f12e7e021f4fc5b6242ee2a (patch)
treee1b94ef835f2ad6796f50e65e906f948c67f76de /src
parent4fb9b7e1467baf57f54e47ab962c6af1769680c0 (diff)
downloadtrackermap-server-bac1fb563352b9908f12e7e021f4fc5b6242ee2a.tar.gz
trackermap-server-bac1fb563352b9908f12e7e021f4fc5b6242ee2a.tar.bz2
trackermap-server-bac1fb563352b9908f12e7e021f4fc5b6242ee2a.zip
din and dout parameters remastered
Diffstat (limited to 'src')
-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());