aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-11-04 22:49:11 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-11-04 22:49:11 -0800
commit52b0a04111a0139d7f426f1486108b7d625494fb (patch)
treedf97cc2249bda0f0837bfbbf26822530b7973b56 /src/main/java/org/traccar
parent0abf58c15f3aaaf14a08694741162d60b6f08c99 (diff)
downloadtraccar-server-52b0a04111a0139d7f426f1486108b7d625494fb.tar.gz
traccar-server-52b0a04111a0139d7f426f1486108b7d625494fb.tar.bz2
traccar-server-52b0a04111a0139d7f426f1486108b7d625494fb.zip
Decoding ignition value
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/RstProtocolDecoder.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/RstProtocolDecoder.java b/src/main/java/org/traccar/protocol/RstProtocolDecoder.java
index 092083f9d..60f5b8d04 100644
--- a/src/main/java/org/traccar/protocol/RstProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/RstProtocolDecoder.java
@@ -20,6 +20,7 @@ import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
import org.traccar.NetworkMessage;
import org.traccar.Protocol;
+import org.traccar.helper.BitUtil;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
import org.traccar.helper.UnitsConverter;
@@ -120,7 +121,10 @@ public class RstProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ODOMETER, parser.nextInt());
position.set(Position.KEY_RSSI, parser.nextInt());
position.set(Position.PREFIX_TEMP + 1, (int) parser.nextHexInt().byteValue());
- position.set(Position.KEY_STATUS, parser.nextHexInt() << 8 + parser.nextHexInt());
+
+ int status = parser.nextHexInt() << 8 + parser.nextHexInt();
+ position.set(Position.KEY_IGNITION, BitUtil.check(status, 7));
+ position.set(Position.KEY_STATUS, status);
return position;
}