diff options
author | jcardus <joaquim.cardeira@gmail.com> | 2020-03-25 17:25:19 +0000 |
---|---|---|
committer | jcardus <joaquim.cardeira@gmail.com> | 2020-03-25 17:25:19 +0000 |
commit | feac85bad4004fb3e316a88285626e12840398d2 (patch) | |
tree | d268a79d63b9d1f27b6e433fedc90de7b427b172 /src/main/java/org/traccar/protocol/BceProtocolDecoder.java | |
parent | 7b669e3181f637f06b31b55bd930584c7b08e897 (diff) | |
parent | f3d465abe7f255ec44e976caade642e4c2fd7598 (diff) | |
download | trackermap-server-feac85bad4004fb3e316a88285626e12840398d2.tar.gz trackermap-server-feac85bad4004fb3e316a88285626e12840398d2.tar.bz2 trackermap-server-feac85bad4004fb3e316a88285626e12840398d2.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/main/java/org/traccar/protocol/BceProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/BceProtocolDecoder.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/org/traccar/protocol/BceProtocolDecoder.java b/src/main/java/org/traccar/protocol/BceProtocolDecoder.java index 30f9bb1f3..a259e027a 100644 --- a/src/main/java/org/traccar/protocol/BceProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/BceProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2019 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 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. @@ -83,10 +83,10 @@ public class BceProtocolDecoder extends BaseProtocolDecoder { buf.skipBytes(4); } if (BitUtil.check(mask, 12)) { - buf.skipBytes(2); + position.set("fuel1", buf.readUnsignedShort()); } if (BitUtil.check(mask, 13)) { - buf.skipBytes(2); + position.set("fuel2", buf.readUnsignedShort()); } if (BitUtil.check(mask, 14)) { @@ -113,7 +113,7 @@ public class BceProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_FUEL_LEVEL, buf.readUnsignedByte()); } if (BitUtil.check(mask, 4)) { - position.set(Position.KEY_RPM, buf.readUnsignedShortLE()); + position.set(Position.KEY_RPM, buf.readUnsignedShortLE() * 0.125); } if (BitUtil.check(mask, 5)) { position.set(Position.KEY_HOURS, buf.readUnsignedIntLE()); @@ -122,7 +122,7 @@ public class BceProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_ODOMETER, buf.readUnsignedIntLE()); } if (BitUtil.check(mask, 7)) { - position.set(Position.KEY_COOLANT_TEMP, (int) buf.readByte()); + position.set(Position.KEY_COOLANT_TEMP, buf.readByte() - 40); } if (BitUtil.check(mask, 8)) { position.set("fuel2", buf.readUnsignedByte()); @@ -217,9 +217,9 @@ public class BceProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedShortLE(); } if (BitUtil.check(mask, 6)) { - buf.readUnsignedByte(); // maximum acceleration - buf.readUnsignedByte(); // maximum deceleration - buf.readUnsignedByte(); // maximum cornering + position.set("maxAcceleration", buf.readUnsignedByte() * 0.02); + position.set("maxBraking", buf.readUnsignedByte() * 0.02); + position.set("maxCornering", buf.readUnsignedByte() * 0.02); } if (BitUtil.check(mask, 7)) { buf.skipBytes(16); |