aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuriy Piskarev <yuriy.piskarev@gmail.com>2022-04-21 21:01:19 +0300
committerYuriy Piskarev <yuriy.piskarev@gmail.com>2022-04-21 21:01:19 +0300
commit56ff656c908b19feb2fa3dcffa48cc3bcdfe9b3b (patch)
treed339e5df615f4089bb8475a9cadc781685dc9ead
parentd7cea343ab528bec603af91c1917159baef465ea (diff)
downloadtrackermap-server-56ff656c908b19feb2fa3dcffa48cc3bcdfe9b3b.tar.gz
trackermap-server-56ff656c908b19feb2fa3dcffa48cc3bcdfe9b3b.tar.bz2
trackermap-server-56ff656c908b19feb2fa3dcffa48cc3bcdfe9b3b.zip
- used "fuelLevel" key
- refactor
-rw-r--r--src/main/java/org/traccar/protocol/NavtelecomProtocolDecoder.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/main/java/org/traccar/protocol/NavtelecomProtocolDecoder.java b/src/main/java/org/traccar/protocol/NavtelecomProtocolDecoder.java
index cd0c3cdcb..ecaa6cbf4 100644
--- a/src/main/java/org/traccar/protocol/NavtelecomProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/NavtelecomProtocolDecoder.java
@@ -298,13 +298,13 @@ public class NavtelecomProtocolDecoder extends BaseProtocolDecoder {
case 53:
value = buf.readUnsignedShortLE();
if (value == 0x7FFF) {
- position.set(Position.KEY_FUEL_LEVEL + "Level", (Boolean) null);
+ position.set("fuelLevel", (Boolean) null);
position.set(Position.KEY_FUEL_LEVEL, (Boolean) null);
} else if (BitUtil.check(value, 7)) {
- position.set(Position.KEY_FUEL_LEVEL + "Level", BitUtil.to(value, 6));
+ position.set("fuelLevel", BitUtil.to(value, 6));
position.set(Position.KEY_FUEL_LEVEL, (Boolean) null);
} else {
- position.set(Position.KEY_FUEL_LEVEL + "Level", (Boolean) null);
+ position.set("fuelLevel", (Boolean) null);
position.set(Position.KEY_FUEL_LEVEL, BitUtil.to(value, 6) / 10);
}
break;
@@ -329,8 +329,7 @@ public class NavtelecomProtocolDecoder extends BaseProtocolDecoder {
case 62:
value = buf.readUnsignedShortLE();
position.set(
- Position.KEY_AXLE_WEIGHT + (j + 2 - 58), (value != 65535) ? value : null
- );
+ Position.KEY_AXLE_WEIGHT + (j + 2 - 58), (value != 65535) ? value : null);
break;
case 63:
value = buf.readUnsignedByte();
@@ -363,15 +362,13 @@ public class NavtelecomProtocolDecoder extends BaseProtocolDecoder {
case 68:
value = buf.readUnsignedShortLE();
position.set(
- Position.KEY_ODOMETER_SERVICE, (value != 0xFFFF) ? (value * 5000) : null
- );
+ Position.KEY_ODOMETER_SERVICE, (value != 0xFFFF) ? (value * 5000) : null);
break;
case 69:
value = buf.readUnsignedByte();
position.set(
Position.KEY_OBD_SPEED,
- (value != 0xFF) ? UnitsConverter.knotsFromKph(value) : null
- );
+ (value != 0xFF) ? UnitsConverter.knotsFromKph(value) : null);
break;
default:
buf.skipBytes(getItemLength(j + 1));