aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorEdward Valley <ed.valley@yandex.com>2019-07-10 21:29:27 -0400
committerEdward Valley <ed.valley@yandex.com>2019-07-10 21:29:27 -0400
commit9990000d67907cb41bdc18639d7dbe081c363f09 (patch)
tree4c90b972247d121d3fecc8e13506e0f82ef0bddf /src/main/java/org/traccar
parent0064dec35205fba7b1c8e6c1c0553407688055a8 (diff)
downloadtraccar-server-9990000d67907cb41bdc18639d7dbe081c363f09.tar.gz
traccar-server-9990000d67907cb41bdc18639d7dbe081c363f09.tar.bz2
traccar-server-9990000d67907cb41bdc18639d7dbe081c363f09.zip
Fixed not receiving ignition off event
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java b/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java
index 3eecf58a3..767d70a5c 100644
--- a/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java
@@ -107,13 +107,17 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder {
private String decodeEvent(String event, Position position) {
+ position.set(Position.KEY_IGNITION, false);
+
if (event.length() == 1) {
char inputStatus = event.charAt(0);
if (inputStatus >= 'A' && inputStatus <= 'D') {
int inputStatusInt = inputStatus - 'A';
position.set(Position.PREFIX_IN + 1, inputStatusInt & 1);
position.set(Position.PREFIX_IN + 2, inputStatusInt & 2);
- position.set(Position.KEY_IGNITION, ((inputStatusInt & 1) != 0) ? true : false);
+ if ((inputStatusInt & 1) != 0) {
+ position.set(Position.KEY_IGNITION, true);
+ }
return null;
}
}