From c62fa33fb0748f44d9584970924c90c70f4f976a Mon Sep 17 00:00:00 2001 From: jon-stumpf Date: Sun, 5 Mar 2017 00:44:48 -0500 Subject: Converted all KEY_POWER and KEY_BATTERY to volts; Removed string "mV"; --- src/org/traccar/protocol/At2000ProtocolDecoder.java | 2 +- src/org/traccar/protocol/EelinkProtocolDecoder.java | 2 +- src/org/traccar/protocol/OigoProtocolDecoder.java | 6 +++--- src/org/traccar/protocol/RitiProtocolDecoder.java | 2 +- src/org/traccar/protocol/TeltonikaProtocolDecoder.java | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/protocol/At2000ProtocolDecoder.java b/src/org/traccar/protocol/At2000ProtocolDecoder.java index 182066629..70840c37d 100644 --- a/src/org/traccar/protocol/At2000ProtocolDecoder.java +++ b/src/org/traccar/protocol/At2000ProtocolDecoder.java @@ -140,7 +140,7 @@ public class At2000ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.PREFIX_ADC + 1, buf.readUnsignedShort()); position.set(Position.PREFIX_ADC + 1, buf.readUnsignedShort()); - position.set(Position.KEY_POWER, buf.readUnsignedShort() + "mV"); + position.set(Position.KEY_POWER, buf.readUnsignedShort() * 0.001); buf.readUnsignedShort(); // cid position.set(Position.KEY_RSSI, buf.readUnsignedByte()); diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java index 0296d22fe..0f6551cc3 100644 --- a/src/org/traccar/protocol/EelinkProtocolDecoder.java +++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java @@ -130,7 +130,7 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder { } position.set(Position.KEY_STATUS, status); - position.set(Position.KEY_BATTERY, buf.readUnsignedShort() + "mV"); + position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.001); position.set(Position.KEY_RSSI, buf.readUnsignedShort()); diff --git a/src/org/traccar/protocol/OigoProtocolDecoder.java b/src/org/traccar/protocol/OigoProtocolDecoder.java index 9538053b6..54360c932 100644 --- a/src/org/traccar/protocol/OigoProtocolDecoder.java +++ b/src/org/traccar/protocol/OigoProtocolDecoder.java @@ -121,11 +121,11 @@ public class OigoProtocolDecoder extends BaseProtocolDecoder { } if (BitUtil.check(mask, 9)) { - position.set(Position.KEY_POWER, buf.readUnsignedShort() + "mV"); + position.set(Position.KEY_POWER, buf.readUnsignedShort() * 0.001); } if (BitUtil.check(mask, 10)) { - position.set(Position.KEY_BATTERY, buf.readUnsignedShort() + "mV"); + position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.001); } if (BitUtil.check(mask, 11)) { @@ -198,7 +198,7 @@ public class OigoProtocolDecoder extends BaseProtocolDecoder { position.setCourse(buf.readUnsignedShort()); position.setSpeed(UnitsConverter.knotsFromMph(buf.readUnsignedByte())); - position.set(Position.KEY_POWER, buf.readUnsignedByte() * 100 + "mV"); + position.set(Position.KEY_POWER, buf.readUnsignedByte() * 0.1); position.set(Position.PREFIX_IO + 1, buf.readUnsignedByte()); dateBuilder.setSecond(buf.readUnsignedByte()); diff --git a/src/org/traccar/protocol/RitiProtocolDecoder.java b/src/org/traccar/protocol/RitiProtocolDecoder.java index 8ff72a9c1..a879633c2 100644 --- a/src/org/traccar/protocol/RitiProtocolDecoder.java +++ b/src/org/traccar/protocol/RitiProtocolDecoder.java @@ -67,7 +67,7 @@ public class RitiProtocolDecoder extends BaseProtocolDecoder { position.set("mode", buf.readUnsignedByte()); position.set(Position.KEY_COMMAND, buf.readUnsignedByte()); - position.set(Position.KEY_POWER, buf.readUnsignedShort() + "mV"); + position.set(Position.KEY_POWER, buf.readUnsignedShort() * 0.001); buf.skipBytes(5); // status buf.readUnsignedShort(); // idleCount diff --git a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java index e55d354cf..30a3f4cda 100644 --- a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java +++ b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java @@ -96,10 +96,10 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder { position.set(Position.PREFIX_ADC + 1, readValue(buf, length, false)); break; case 66: - position.set(Position.KEY_POWER, readValue(buf, length, false) + "mV"); + position.set(Position.KEY_POWER, readValue(buf, length, false) * 0.001); break; case 67: - position.set(Position.KEY_BATTERY, readValue(buf, length, false) + "mV"); + position.set(Position.KEY_BATTERY, readValue(buf, length, false) * 0.001); break; case 70: position.set(Position.KEY_DEVICE_TEMP, readValue(buf, length, true) * 0.1); -- cgit v1.2.3