From 1a4981e5adf0832d8590c964f00578179d85eb98 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 19 May 2020 22:14:49 -0700 Subject: Update PST decoder --- src/main/java/org/traccar/protocol/PstProtocolDecoder.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main/java/org/traccar') diff --git a/src/main/java/org/traccar/protocol/PstProtocolDecoder.java b/src/main/java/org/traccar/protocol/PstProtocolDecoder.java index 68d32636c..0c7826e42 100644 --- a/src/main/java/org/traccar/protocol/PstProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/PstProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Anton Tananaev (anton@traccar.org) + * Copyright 2019 - 2020 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,10 +86,16 @@ public class PstProtocolDecoder extends BaseProtocolDecoder { int length = buf.readUnsignedByte(); switch (tag) { + case 0x09: + buf.readUnsignedByte(); // sensor count + buf.readUnsignedByte(); // sensor logic + int status = buf.readUnsignedByte(); + position.set(Position.KEY_IGNITION, BitUtil.check(status, 7)); + break; case 0x0D: int battery = buf.readUnsignedByte(); if (battery <= 20) { - position.set(Position.KEY_BATTERY_LEVEL, buf.readUnsignedByte() * 5); + position.set(Position.KEY_BATTERY_LEVEL, battery * 5); } break; case 0x10: -- cgit v1.2.3