diff options
Diffstat (limited to 'src/org/traccar/protocol')
16 files changed, 24 insertions, 25 deletions
diff --git a/src/org/traccar/protocol/AtrackProtocolDecoder.java b/src/org/traccar/protocol/AtrackProtocolDecoder.java index 60d5244a0..cb89f9438 100644 --- a/src/org/traccar/protocol/AtrackProtocolDecoder.java +++ b/src/org/traccar/protocol/AtrackProtocolDecoder.java @@ -227,7 +227,7 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder { position.setCourse(buf.readUnsignedShort()); position.set(Position.KEY_TYPE, buf.readUnsignedByte()); - position.set(Position.KEY_ODOMETER, buf.readUnsignedInt() * 0.1); + position.set(Position.KEY_ODOMETER, buf.readUnsignedInt() * 100); position.set(Position.KEY_HDOP, buf.readUnsignedShort() * 0.1); position.set(Position.KEY_INPUT, buf.readUnsignedByte()); diff --git a/src/org/traccar/protocol/BoxProtocolDecoder.java b/src/org/traccar/protocol/BoxProtocolDecoder.java index f0a90ad97..55d3142b2 100644 --- a/src/org/traccar/protocol/BoxProtocolDecoder.java +++ b/src/org/traccar/protocol/BoxProtocolDecoder.java @@ -92,7 +92,7 @@ public class BoxProtocolDecoder extends BaseProtocolDecoder { position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble())); position.setCourse(parser.nextDouble()); - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_DISTANCE, parser.nextDouble() * 1000); position.set(Position.KEY_EVENT, parser.next()); int status = parser.nextInt(); diff --git a/src/org/traccar/protocol/DishaProtocolDecoder.java b/src/org/traccar/protocol/DishaProtocolDecoder.java index fb540c8d3..eb00700d8 100644 --- a/src/org/traccar/protocol/DishaProtocolDecoder.java +++ b/src/org/traccar/protocol/DishaProtocolDecoder.java @@ -97,7 +97,7 @@ public class DishaProtocolDecoder extends BaseProtocolDecoder { position.set(Position.PREFIX_ADC + 1, parser.nextInt()); position.set(Position.PREFIX_ADC + 2, parser.nextInt()); - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); position.set(Position.KEY_INPUT, parser.next()); return position; diff --git a/src/org/traccar/protocol/EasyTrackProtocolDecoder.java b/src/org/traccar/protocol/EasyTrackProtocolDecoder.java index 41f395fd9..cec68b967 100644 --- a/src/org/traccar/protocol/EasyTrackProtocolDecoder.java +++ b/src/org/traccar/protocol/EasyTrackProtocolDecoder.java @@ -105,7 +105,7 @@ public class EasyTrackProtocolDecoder extends BaseProtocolDecoder { position.set("signal", parser.next()); position.set(Position.KEY_POWER, parser.nextDouble()); position.set("oil", parser.nextInt(16)); - position.set(Position.KEY_ODOMETER, parser.nextInt(16)); + position.set(Position.KEY_ODOMETER, parser.nextInt(16) * 100); position.setAltitude(parser.nextDouble()); diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index 148fc6357..385039399 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -308,7 +308,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { parser.skip(4); // alternative networks - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); } private Object decodeObd(Channel channel, SocketAddress remoteAddress, String sentence) { @@ -392,7 +392,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_POWER, power); } - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); position.set(Position.KEY_BATTERY, parser.next()); position.set(Position.KEY_ODOMETER, parser.next()); @@ -446,7 +446,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { decodeLocation(position, parser); position.set(Position.KEY_HOURS, parser.next()); - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); if (parser.hasNext(6)) { DateBuilder dateBuilder = new DateBuilder() @@ -479,7 +479,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { decodeLocation(position, parser); - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); if (parser.hasNext(6)) { DateBuilder dateBuilder = new DateBuilder() @@ -518,7 +518,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_ODOMETER, parser.next()); position.set(Position.KEY_BATTERY, parser.next()); - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); // workaround for wrong location time if (parser.hasNext(6)) { diff --git a/src/org/traccar/protocol/IntellitracProtocolDecoder.java b/src/org/traccar/protocol/IntellitracProtocolDecoder.java index 88c247253..af9f9bbab 100644 --- a/src/org/traccar/protocol/IntellitracProtocolDecoder.java +++ b/src/org/traccar/protocol/IntellitracProtocolDecoder.java @@ -114,7 +114,7 @@ public class IntellitracProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_CHARGE, parser.next()); position.set("tpl", parser.next()); position.set("axle", parser.next()); - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_OBD_ODOMETER, parser.next()); return position; } diff --git a/src/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/org/traccar/protocol/Jt600ProtocolDecoder.java index 372b4cac1..b7193d24b 100644 --- a/src/org/traccar/protocol/Jt600ProtocolDecoder.java +++ b/src/org/traccar/protocol/Jt600ProtocolDecoder.java @@ -110,7 +110,7 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { int fuel = buf.readUnsignedByte() << 8; position.set(Position.KEY_STATUS, buf.readUnsignedInt()); - position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); + position.set(Position.KEY_ODOMETER, buf.readUnsignedInt() * 1000); fuel += buf.readUnsignedByte(); position.set(Position.KEY_FUEL, fuel); diff --git a/src/org/traccar/protocol/MegastekProtocolDecoder.java b/src/org/traccar/protocol/MegastekProtocolDecoder.java index d20532faa..71aae6ca3 100644 --- a/src/org/traccar/protocol/MegastekProtocolDecoder.java +++ b/src/org/traccar/protocol/MegastekProtocolDecoder.java @@ -305,7 +305,7 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder { position.setCourse(parser.nextDouble()); position.setAltitude(parser.nextDouble()); - position.set(Position.KEY_ODOMETER, parser.nextDouble()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); position.set(Position.KEY_MCC, parser.nextInt()); position.set(Position.KEY_MNC, parser.nextInt()); position.set(Position.KEY_LAC, parser.nextInt(16)); diff --git a/src/org/traccar/protocol/Mta6ProtocolDecoder.java b/src/org/traccar/protocol/Mta6ProtocolDecoder.java index b6aea9092..1da55f715 100644 --- a/src/org/traccar/protocol/Mta6ProtocolDecoder.java +++ b/src/org/traccar/protocol/Mta6ProtocolDecoder.java @@ -155,7 +155,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder { } if (BitUtil.check(flags, 3)) { - position.set(Position.KEY_ODOMETER, buf.readUnsignedShort()); + position.set(Position.KEY_ODOMETER, buf.readUnsignedShort() * 1000); } if (BitUtil.check(flags, 4)) { diff --git a/src/org/traccar/protocol/NavisProtocolDecoder.java b/src/org/traccar/protocol/NavisProtocolDecoder.java index 72c5f53c3..03e578fe9 100644 --- a/src/org/traccar/protocol/NavisProtocolDecoder.java +++ b/src/org/traccar/protocol/NavisProtocolDecoder.java @@ -147,9 +147,8 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { position.setSpeed(buf.readFloat()); position.setCourse(buf.readUnsignedShort()); - position.set(Position.KEY_ODOMETER, buf.readFloat()); - - position.set("segment", buf.readFloat()); // last segment + position.set(Position.KEY_ODOMETER, buf.readFloat() * 1000); + position.set(Position.KEY_DISTANCE, buf.readFloat()); // Segment times buf.readUnsignedShort(); diff --git a/src/org/traccar/protocol/Pt502ProtocolDecoder.java b/src/org/traccar/protocol/Pt502ProtocolDecoder.java index 1436eb5ac..d925e1b4d 100644 --- a/src/org/traccar/protocol/Pt502ProtocolDecoder.java +++ b/src/org/traccar/protocol/Pt502ProtocolDecoder.java @@ -106,7 +106,7 @@ public class Pt502ProtocolDecoder extends BaseProtocolDecoder { }
}
- position.set(Position.KEY_ODOMETER, parser.next());
+ position.set(Position.KEY_ODOMETER, parser.nextInt());
position.set(Position.KEY_RFID, parser.next());
if (parser.hasNext()) {
diff --git a/src/org/traccar/protocol/RitiProtocolDecoder.java b/src/org/traccar/protocol/RitiProtocolDecoder.java index bf041554f..455c1387a 100644 --- a/src/org/traccar/protocol/RitiProtocolDecoder.java +++ b/src/org/traccar/protocol/RitiProtocolDecoder.java @@ -73,8 +73,8 @@ public class RitiProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedShort(); buf.readUnsignedShort(); - position.set("distance", buf.readUnsignedInt()); - position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); + position.set(Position.KEY_DISTANCE, buf.readUnsignedInt()); + position.set(Position.KEY_TRIP_ODOMETER, buf.readUnsignedInt()); // Parse GPRMC int end = buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) '*'); diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java index 72c0f6306..e7a689a8b 100644 --- a/src/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/org/traccar/protocol/TotemProtocolDecoder.java @@ -252,7 +252,7 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { } position.set(Position.PREFIX_TEMP + 1, parser.next()); - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); } else if (pattern == PATTERN3) { if (parser.hasNext()) { @@ -314,7 +314,7 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble())); position.set(Position.KEY_HDOP, parser.nextDouble()); - position.set(Position.KEY_ODOMETER, parser.nextInt()); + position.set(Position.KEY_ODOMETER, parser.nextInt() * 1000); position.setValid(true); position.setLatitude(parser.nextCoordinate()); diff --git a/src/org/traccar/protocol/TytanProtocolDecoder.java b/src/org/traccar/protocol/TytanProtocolDecoder.java index 2733a568b..7b5dc5ffe 100644 --- a/src/org/traccar/protocol/TytanProtocolDecoder.java +++ b/src/org/traccar/protocol/TytanProtocolDecoder.java @@ -49,7 +49,7 @@ public class TytanProtocolDecoder extends BaseProtocolDecoder { switch (type) { case 2: - position.set(Position.KEY_ODOMETER, buf.readUnsignedMedium()); + position.set(Position.KEY_TRIP_ODOMETER, buf.readUnsignedMedium()); break; case 5: position.set(Position.KEY_INPUT, buf.readUnsignedByte()); diff --git a/src/org/traccar/protocol/WondexProtocolDecoder.java b/src/org/traccar/protocol/WondexProtocolDecoder.java index d048b9b31..97426d78c 100644 --- a/src/org/traccar/protocol/WondexProtocolDecoder.java +++ b/src/org/traccar/protocol/WondexProtocolDecoder.java @@ -115,7 +115,7 @@ public class WondexProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_EVENT, parser.next()); position.set(Position.KEY_BATTERY, parser.next()); - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); position.set(Position.KEY_INPUT, parser.next()); position.set(Position.PREFIX_ADC + 1, parser.next()); position.set(Position.PREFIX_ADC + 2, parser.next()); diff --git a/src/org/traccar/protocol/XirgoProtocolDecoder.java b/src/org/traccar/protocol/XirgoProtocolDecoder.java index df5665992..830caf6d9 100644 --- a/src/org/traccar/protocol/XirgoProtocolDecoder.java +++ b/src/org/traccar/protocol/XirgoProtocolDecoder.java @@ -133,7 +133,7 @@ public class XirgoProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_HDOP, parser.next()); if (newFormat) { - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1609.34); position.set(Position.KEY_FUEL_CONSUMPTION, parser.next()); } @@ -141,7 +141,7 @@ public class XirgoProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_GSM, parser.next()); if (!newFormat) { - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1609.34); } position.setValid(parser.nextInt() == 1); |