diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-09-11 19:25:07 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-09-11 19:25:07 -0700 |
commit | 55b0a40e51e0bee5d37f0f3d34b6f1dd287973f9 (patch) | |
tree | 9daf7227a08245bdd44aa84075f502e666ce2a56 /src/main/java/org | |
parent | fad34efb33168af205f47869d5525b3c1c4343a2 (diff) | |
download | trackermap-server-55b0a40e51e0bee5d37f0f3d34b6f1dd287973f9.tar.gz trackermap-server-55b0a40e51e0bee5d37f0f3d34b6f1dd287973f9.tar.bz2 trackermap-server-55b0a40e51e0bee5d37f0f3d34b6f1dd287973f9.zip |
Decode Portman ignition
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/traccar/protocol/PortmanProtocolDecoder.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/PortmanProtocolDecoder.java b/src/main/java/org/traccar/protocol/PortmanProtocolDecoder.java index ebb93abd6..e1847a2b2 100644 --- a/src/main/java/org/traccar/protocol/PortmanProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/PortmanProtocolDecoder.java @@ -80,7 +80,15 @@ public class PortmanProtocolDecoder extends BaseProtocolDecoder { position.set(Position.PREFIX_TEMP + 1, parser.next()); position.set(Position.KEY_STATUS, parser.nextHexLong()); position.set(Position.KEY_DRIVER_UNIQUE_ID, parser.next()); - position.set(Position.KEY_EVENT, parser.nextInt()); + + int event = parser.nextInt(); + position.set(Position.KEY_EVENT, event); + if (event == 253) { + position.set(Position.KEY_IGNITION, true); + } else if (event == 254) { + position.set(Position.KEY_IGNITION, false); + } + position.set(Position.KEY_SATELLITES, parser.nextInt()); position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); position.set(Position.KEY_RSSI, parser.nextInt()); |