aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar')
-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());