From bac1fb563352b9908f12e7e021f4fc5b6242ee2a Mon Sep 17 00:00:00 2001 From: namo Date: Wed, 20 Dec 2017 17:37:06 +0300 Subject: din and dout parameters remastered --- src/org/traccar/protocol/FlespiProtocolDecoder.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/org/traccar') 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()); -- cgit v1.2.3