diff options
Diffstat (limited to 'src')
21 files changed, 89 insertions, 91 deletions
diff --git a/src/org/traccar/protocol/AdmProtocolDecoder.java b/src/org/traccar/protocol/AdmProtocolDecoder.java index a69743222..f4a21cad0 100644 --- a/src/org/traccar/protocol/AdmProtocolDecoder.java +++ b/src/org/traccar/protocol/AdmProtocolDecoder.java @@ -66,7 +66,7 @@ public class AdmProtocolDecoder extends BaseProtocolDecoder { position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); - position.set(Position.KEY_VERSION_FW, buf.readUnsignedByte()); // firmware version + position.set(Position.KEY_VERSION_FW, buf.readUnsignedByte()); buf.readUnsignedShort(); // index position.set(Position.KEY_STATUS, buf.readUnsignedShort()); @@ -77,7 +77,7 @@ public class AdmProtocolDecoder extends BaseProtocolDecoder { position.setCourse(buf.readUnsignedShort() * 0.1); position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShort() * 0.1)); - position.set(Position.KEY_ACCELERATION, buf.readUnsignedByte()); // acceleration + position.set(Position.KEY_ACCELERATION, buf.readUnsignedByte()); position.setAltitude(buf.readUnsignedShort()); diff --git a/src/org/traccar/protocol/AplicomProtocolDecoder.java b/src/org/traccar/protocol/AplicomProtocolDecoder.java index f98ca61a9..93882cd4a 100644 --- a/src/org/traccar/protocol/AplicomProtocolDecoder.java +++ b/src/org/traccar/protocol/AplicomProtocolDecoder.java @@ -120,7 +120,7 @@ public class AplicomProtocolDecoder extends BaseProtocolDecoder { private void decodeCanData(ChannelBuffer buf, Position position) { buf.readUnsignedMedium(); // packet identifier - position.set(Position.KEY_VERSION_FW, buf.readUnsignedByte()); // version + position.set(Position.KEY_VERSION_FW, buf.readUnsignedByte()); int count = buf.readUnsignedByte(); buf.readUnsignedByte(); // batch count buf.readUnsignedShort(); // selector bit @@ -436,10 +436,10 @@ public class AplicomProtocolDecoder extends BaseProtocolDecoder { return; } - position.set(Position.KEY_VERSION_FW, buf.readUnsignedByte()); // version - position.set(Position.KEY_EVENT, buf.readUnsignedShort()); // event - position.set("dataValidity", buf.readUnsignedByte()); // data validity - position.set("towed", buf.readUnsignedByte()); // towed + position.set(Position.KEY_VERSION_FW, buf.readUnsignedByte()); + position.set(Position.KEY_EVENT, buf.readUnsignedShort()); + position.set("dataValidity", buf.readUnsignedByte()); + position.set("towed", buf.readUnsignedByte()); buf.readUnsignedShort(); // length while (buf.readableBytes() > 0) { diff --git a/src/org/traccar/protocol/ArknavX8ProtocolDecoder.java b/src/org/traccar/protocol/ArknavX8ProtocolDecoder.java index 33d204de1..24c155c84 100644 --- a/src/org/traccar/protocol/ArknavX8ProtocolDecoder.java +++ b/src/org/traccar/protocol/ArknavX8ProtocolDecoder.java @@ -70,7 +70,7 @@ public class ArknavX8ProtocolDecoder extends BaseProtocolDecoder { position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); - position.set(Position.KEY_TYPE, parser.next()); // type + position.set(Position.KEY_TYPE, parser.next()); DateBuilder dateBuilder = new DateBuilder() .setDate(parser.nextInt(), parser.nextInt(), parser.nextInt()) diff --git a/src/org/traccar/protocol/AtrackProtocolDecoder.java b/src/org/traccar/protocol/AtrackProtocolDecoder.java index 8e9d051f4..8e444102e 100644 --- a/src/org/traccar/protocol/AtrackProtocolDecoder.java +++ b/src/org/traccar/protocol/AtrackProtocolDecoder.java @@ -122,7 +122,7 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_RPM, buf.readUnsignedShort()); break; case "GS": - position.set(Position.KEY_RSSI, buf.readUnsignedByte()); // gsm status + position.set(Position.KEY_RSSI, buf.readUnsignedByte()); break; case "DT": position.set(Position.KEY_ARCHIVE, buf.readUnsignedByte() == 1); @@ -149,7 +149,7 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedByte(); // mil status break; case "FC": - position.set(Position.KEY_FUEL_CONSUMPTION, buf.readUnsignedInt()); // fuel used + position.set(Position.KEY_FUEL_CONSUMPTION, buf.readUnsignedInt()); break; case "CI": readString(buf); // format string diff --git a/src/org/traccar/protocol/AutoFonProtocolDecoder.java b/src/org/traccar/protocol/AutoFonProtocolDecoder.java index 9a62a353e..32b4bfa74 100644 --- a/src/org/traccar/protocol/AutoFonProtocolDecoder.java +++ b/src/org/traccar/protocol/AutoFonProtocolDecoder.java @@ -70,7 +70,7 @@ public class AutoFonProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedByte(); // interval buf.skipBytes(8); // settings } - position.set(Position.KEY_STATUS, buf.readUnsignedByte()); // status + position.set(Position.KEY_STATUS, buf.readUnsignedByte()); if (!history) { buf.readUnsignedShort(); } diff --git a/src/org/traccar/protocol/CarcellProtocolDecoder.java b/src/org/traccar/protocol/CarcellProtocolDecoder.java index feec7a83c..70e99558e 100644 --- a/src/org/traccar/protocol/CarcellProtocolDecoder.java +++ b/src/org/traccar/protocol/CarcellProtocolDecoder.java @@ -127,7 +127,7 @@ public class CarcellProtocolDecoder extends BaseProtocolDecoder { position.set("jamming", parser.next().equals("1")); position.set(Position.KEY_GPS, parser.nextInt()); - position.set("clockType", parser.next()); // clock type + position.set("clockType", parser.next()); DateBuilder dateBuilder = new DateBuilder(). setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()) @@ -140,7 +140,7 @@ public class CarcellProtocolDecoder extends BaseProtocolDecoder { if (parser.hasNext(4)) { position.set("cloned", parser.next().equals("1")); - position.set(Position.KEY_ALARM, parser.next()); // panic button status + position.set(Position.KEY_ALARM, parser.next()); String painelStatus = parser.next(); if (painelStatus.equals("1")) { @@ -154,7 +154,7 @@ public class CarcellProtocolDecoder extends BaseProtocolDecoder { if (parser.hasNext(5)) { position.set("timeUntilDelivery", parser.nextInt()); - position.set(Position.KEY_ALARM, parser.next()); // panic button status + position.set(Position.KEY_ALARM, parser.next()); position.set(Position.KEY_INPUT, parser.next()); // aux Double mainVoltage = parser.nextDouble() / 100d; diff --git a/src/org/traccar/protocol/CastelProtocolDecoder.java b/src/org/traccar/protocol/CastelProtocolDecoder.java index 52d7f4edb..83664fa5a 100644 --- a/src/org/traccar/protocol/CastelProtocolDecoder.java +++ b/src/org/traccar/protocol/CastelProtocolDecoder.java @@ -178,8 +178,8 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedInt(); // ACC ON time buf.readUnsignedInt(); // UTC time position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); - position.set(Position.KEY_ODOMETER_TRIP, buf.readUnsignedInt()); // trip odometer - position.set(Position.KEY_FUEL_CONSUMPTION, buf.readUnsignedInt()); // total fuel consumption + position.set(Position.KEY_ODOMETER_TRIP, buf.readUnsignedInt()); + position.set(Position.KEY_FUEL_CONSUMPTION, buf.readUnsignedInt()); buf.readUnsignedShort(); // current fuel consumption position.set(Position.KEY_STATUS, buf.readUnsignedInt()); buf.skipBytes(8); @@ -263,8 +263,8 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedInt(); // ACC ON time buf.readUnsignedInt(); // UTC time long odometer = buf.readUnsignedInt(); - long tripOdometer = buf.readUnsignedInt(); // trip odometer - long fuelConsumption = buf.readUnsignedInt(); // total fuel consumption + long tripOdometer = buf.readUnsignedInt(); + long fuelConsumption = buf.readUnsignedInt(); buf.readUnsignedShort(); // current fuel consumption long status = buf.readUnsignedInt(); buf.skipBytes(8); diff --git a/src/org/traccar/protocol/CellocatorProtocolDecoder.java b/src/org/traccar/protocol/CellocatorProtocolDecoder.java index ce43cce37..2b4fa9fb6 100644 --- a/src/org/traccar/protocol/CellocatorProtocolDecoder.java +++ b/src/org/traccar/protocol/CellocatorProtocolDecoder.java @@ -109,9 +109,9 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder { } position.setDeviceId(deviceSession.getDeviceId()); - position.set(Position.KEY_VERSION_HW, buf.readUnsignedByte()); // hardware version - position.set(Position.KEY_VERSION_FW, buf.readUnsignedByte()); // software version - position.set("protocolVersion", buf.readUnsignedByte()); // protocol version + position.set(Position.KEY_VERSION_HW, buf.readUnsignedByte()); + position.set(Position.KEY_VERSION_FW, buf.readUnsignedByte()); + position.set("protocolVersion", buf.readUnsignedByte()); position.set(Position.KEY_STATUS, buf.getUnsignedByte(buf.readerIndex()) & 0x0f); @@ -121,21 +121,21 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedByte(); // reason data position.set(Position.KEY_ALARM, decodeAlarm(buf.readUnsignedByte())); - position.set("mode", buf.readUnsignedByte()); // mode - position.set(Position.PREFIX_IO + 1, buf.readUnsignedInt()); // IO + position.set("mode", buf.readUnsignedByte()); + position.set(Position.PREFIX_IO + 1, buf.readUnsignedInt()); operator <<= 8; operator += buf.readUnsignedByte(); position.set(Position.KEY_OPERATOR, operator); - position.set(Position.PREFIX_ADC + 1, buf.readUnsignedInt()); // ADC - position.set(Position.KEY_ODOMETER, buf.readUnsignedMedium()); // Odometer + position.set(Position.PREFIX_ADC + 1, buf.readUnsignedInt()); + position.set(Position.KEY_ODOMETER, buf.readUnsignedMedium()); buf.skipBytes(6); // multi-purpose data - position.set(Position.KEY_GPS, buf.readUnsignedShort()); // gps fix - position.set("locationStatus", buf.readUnsignedByte()); // location status - position.set("mode1", buf.readUnsignedByte()); // mode 1 - position.set("mode2", buf.readUnsignedByte()); // mode 2 + position.set(Position.KEY_GPS, buf.readUnsignedShort()); + position.set("locationStatus", buf.readUnsignedByte()); + position.set("mode1", buf.readUnsignedByte()); + position.set("mode2", buf.readUnsignedByte()); position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java index 30ed5e2ef..0296d22fe 100644 --- a/src/org/traccar/protocol/EelinkProtocolDecoder.java +++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java @@ -132,7 +132,7 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_BATTERY, buf.readUnsignedShort() + "mV"); - position.set(Position.KEY_RSSI, buf.readUnsignedShort()); // signal strength + position.set(Position.KEY_RSSI, buf.readUnsignedShort()); position.set(Position.PREFIX_ADC + 1, buf.readUnsignedShort()); position.set(Position.PREFIX_ADC + 2, buf.readUnsignedShort()); diff --git a/src/org/traccar/protocol/FifotrackProtocolDecoder.java b/src/org/traccar/protocol/FifotrackProtocolDecoder.java index d140e991f..995722fa7 100644 --- a/src/org/traccar/protocol/FifotrackProtocolDecoder.java +++ b/src/org/traccar/protocol/FifotrackProtocolDecoder.java @@ -83,7 +83,7 @@ public class FifotrackProtocolDecoder extends BaseProtocolDecoder { position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); - position.set(Position.KEY_ALARM, parser.next()); // alarm + position.set(Position.KEY_ALARM, parser.next()); DateBuilder dateBuilder = new DateBuilder() .setDate(parser.nextInt(), parser.nextInt(), parser.nextInt()) diff --git a/src/org/traccar/protocol/IdplProtocolDecoder.java b/src/org/traccar/protocol/IdplProtocolDecoder.java index afc56a18d..6200f6131 100644 --- a/src/org/traccar/protocol/IdplProtocolDecoder.java +++ b/src/org/traccar/protocol/IdplProtocolDecoder.java @@ -94,14 +94,14 @@ public class IdplProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_SATELLITES, parser.nextInt()); position.set(Position.KEY_RSSI, parser.nextInt()); - position.set("vehicleStatus", parser.next()); // vehicle status + position.set("vehicleStatus", parser.next()); position.set(Position.KEY_POWER, parser.nextInt()); position.set(Position.KEY_BATTERY, parser.nextDouble()); if (parser.nextInt() == 1) { position.set(Position.KEY_ALARM, Position.ALARM_SOS); } - position.set("bodyTamper", parser.nextInt()); // body tamper - position.set("acStatus", parser.nextInt()); // ac status + position.set("bodyTamper", parser.nextInt()); + position.set("acStatus", parser.nextInt()); position.set(Position.KEY_IGNITION, parser.nextInt() == 1); position.set(Position.KEY_OUTPUT, parser.nextInt()); position.set(Position.PREFIX_ADC + 1, parser.nextInt()); diff --git a/src/org/traccar/protocol/Mta6ProtocolDecoder.java b/src/org/traccar/protocol/Mta6ProtocolDecoder.java index 35695e177..7f547f648 100644 --- a/src/org/traccar/protocol/Mta6ProtocolDecoder.java +++ b/src/org/traccar/protocol/Mta6ProtocolDecoder.java @@ -182,7 +182,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder { if (BitUtil.check(flags, 7)) { position.set(Position.KEY_BATTERY, buf.getUnsignedByte(buf.readerIndex()) >> 2); position.set(Position.KEY_POWER, buf.readUnsignedShort() & 0x03ff); - position.set("microcontrollerTemperature", buf.readByte()); // microcontroller temperature + position.set("microcontrollerTemperature", buf.readByte()); position.set(Position.KEY_RSSI, (buf.getUnsignedByte(buf.readerIndex()) >> 4) & 0x07); diff --git a/src/org/traccar/protocol/MxtProtocolDecoder.java b/src/org/traccar/protocol/MxtProtocolDecoder.java index b0b587be3..49987ce57 100644 --- a/src/org/traccar/protocol/MxtProtocolDecoder.java +++ b/src/org/traccar/protocol/MxtProtocolDecoder.java @@ -137,7 +137,7 @@ public class MxtProtocolDecoder extends BaseProtocolDecoder { position.setAccuracy(buf.readUnsignedByte()); position.set(Position.KEY_RSSI, buf.readUnsignedByte()); buf.readUnsignedShort(); // time since boot - position.set(Position.KEY_POWER, buf.readUnsignedByte()); // input voltage + position.set(Position.KEY_POWER, buf.readUnsignedByte()); position.set(Position.PREFIX_TEMP + 1, buf.readByte()); } diff --git a/src/org/traccar/protocol/NavigilProtocolDecoder.java b/src/org/traccar/protocol/NavigilProtocolDecoder.java index e0db3d92b..360b9c81c 100644 --- a/src/org/traccar/protocol/NavigilProtocolDecoder.java +++ b/src/org/traccar/protocol/NavigilProtocolDecoder.java @@ -89,25 +89,25 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { position.setDeviceId(deviceSession.getDeviceId()); buf.readUnsignedShort(); // report trigger - position.set(Position.KEY_FLAGS, buf.readUnsignedShort()); // flags + position.set(Position.KEY_FLAGS, buf.readUnsignedShort()); position.setLatitude(buf.readInt() * 0.0000001); position.setLongitude(buf.readInt() * 0.0000001); position.setAltitude(buf.readUnsignedShort()); - position.set(Position.KEY_SATELLITES, buf.readUnsignedShort()); // satellites in fix - position.set(Position.KEY_SATELLITES_VISIBLE, buf.readUnsignedShort()); // satellites in track - position.set("gpsAntennaState", buf.readUnsignedShort()); // GPS antenna state + position.set(Position.KEY_SATELLITES, buf.readUnsignedShort()); + position.set(Position.KEY_SATELLITES_VISIBLE, buf.readUnsignedShort()); + position.set("gpsAntennaState", buf.readUnsignedShort()); position.setSpeed(buf.readUnsignedShort() * 0.194384); position.setCourse(buf.readUnsignedShort()); - position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); // distance in meters - position.set(Position.KEY_DISTANCE, buf.readUnsignedInt()); // delta distance in meters + position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); + position.set(Position.KEY_DISTANCE, buf.readUnsignedInt()); position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.001); - position.set(Position.KEY_CHARGE, buf.readUnsignedShort()); // battery charger status + position.set(Position.KEY_CHARGE, buf.readUnsignedShort()); position.setTime(convertTimestamp(buf.readUnsignedInt())); @@ -133,15 +133,15 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { position.setLongitude(buf.readInt() * 0.0000001); position.setAltitude(buf.readUnsignedShort()); - position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); // satellites in fix - position.set(Position.KEY_SATELLITES_VISIBLE, buf.readUnsignedByte()); // satellites in track + position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); + position.set(Position.KEY_SATELLITES_VISIBLE, buf.readUnsignedByte()); position.setSpeed(buf.readUnsignedShort() * 0.194384); position.setCourse(buf.readUnsignedShort()); - position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); // distance - position.set("maximumSpeed", buf.readUnsignedShort()); // maximum speed - position.set("minimumSpeed", buf.readUnsignedShort()); // minimum speed + position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); + position.set("maximumSpeed", buf.readUnsignedShort()); + position.set("minimumSpeed", buf.readUnsignedShort()); position.set(Position.PREFIX_IO + 1, buf.readUnsignedShort()); // VSAUT1 voltage position.set(Position.PREFIX_IO + 2, buf.readUnsignedShort()); // VSAUT2 voltage @@ -195,7 +195,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { position.setValid((flags & 0x80) == 0x80 && (flags & 0x40) == 0x40); position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); - position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); // distance + position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); return position; } @@ -222,15 +222,15 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { position.setLongitude(buf.readInt() * 0.0000001); position.setAltitude(buf.readUnsignedShort()); - position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); // satellites in fix - position.set(Position.KEY_SATELLITES_VISIBLE, buf.readUnsignedByte()); // satellites in track + position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); + position.set(Position.KEY_SATELLITES_VISIBLE, buf.readUnsignedByte()); position.setSpeed(buf.readUnsignedShort() * 0.194384); position.setCourse(buf.readUnsignedShort() * 0.1); - position.set("maximumSpeed", buf.readUnsignedByte()); // maximum speed - position.set("minimumSpeed", buf.readUnsignedByte()); // minimum speed - position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); // distance + position.set("maximumSpeed", buf.readUnsignedByte()); + position.set("minimumSpeed", buf.readUnsignedByte()); + position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); position.set(Position.PREFIX_IO + 1, buf.readUnsignedByte()); // supply voltage 1 position.set(Position.PREFIX_IO + 2, buf.readUnsignedByte()); // supply voltage 2 @@ -261,11 +261,9 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedByte())); position.setCourse(buf.readUnsignedByte() * 2.0); - position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); // satellites in fix - + position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.001); - - position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); // distance + position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); return position; } diff --git a/src/org/traccar/protocol/PricolProtocolDecoder.java b/src/org/traccar/protocol/PricolProtocolDecoder.java index 6d275d4c0..a33e19b90 100644 --- a/src/org/traccar/protocol/PricolProtocolDecoder.java +++ b/src/org/traccar/protocol/PricolProtocolDecoder.java @@ -51,11 +51,11 @@ public class PricolProtocolDecoder extends BaseProtocolDecoder { position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); - position.set("eventType", buf.readUnsignedByte()); // event type - position.set("packetVersion", buf.readUnsignedByte()); // packet version - position.set(Position.KEY_STATUS, buf.readUnsignedByte()); // device status - position.set(Position.KEY_RSSI, buf.readUnsignedByte()); // gsm status - position.set(Position.KEY_GPS, buf.readUnsignedByte()); // gps status + position.set("eventType", buf.readUnsignedByte()); + position.set("packetVersion", buf.readUnsignedByte()); + position.set(Position.KEY_STATUS, buf.readUnsignedByte()); + position.set(Position.KEY_RSSI, buf.readUnsignedByte()); + position.set(Position.KEY_GPS, buf.readUnsignedByte()); position.setTime(new DateBuilder() .setDateReverse(buf.readUnsignedByte(), buf.readUnsignedByte(), buf.readUnsignedByte()) @@ -76,8 +76,8 @@ public class PricolProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_INPUT, buf.readUnsignedShort()); position.set(Position.KEY_OUTPUT, buf.readUnsignedByte()); - position.set("analogAlerts", buf.readUnsignedByte()); // analog alerts - position.set("customAlertTypes", buf.readUnsignedShort()); // custom alert types + position.set("analogAlerts", buf.readUnsignedByte()); + position.set("customAlertTypes", buf.readUnsignedShort()); for (int i = 1; i <= 5; i++) { position.set(Position.PREFIX_ADC + i, buf.readUnsignedShort()); diff --git a/src/org/traccar/protocol/RitiProtocolDecoder.java b/src/org/traccar/protocol/RitiProtocolDecoder.java index 7f81ef09c..bbd176b38 100644 --- a/src/org/traccar/protocol/RitiProtocolDecoder.java +++ b/src/org/traccar/protocol/RitiProtocolDecoder.java @@ -67,14 +67,14 @@ 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()); buf.skipBytes(5); // status buf.readUnsignedShort(); // idleCount buf.readUnsignedShort(); // idleTime in seconds - position.set(Position.KEY_DISTANCE, buf.readUnsignedInt()); // meters - position.set(Position.KEY_ODOMETER_TRIP, buf.readUnsignedInt()); // meters + position.set(Position.KEY_DISTANCE, buf.readUnsignedInt()); + position.set(Position.KEY_ODOMETER_TRIP, buf.readUnsignedInt()); // Parse GPRMC int end = buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) '*'); diff --git a/src/org/traccar/protocol/SkypatrolProtocolDecoder.java b/src/org/traccar/protocol/SkypatrolProtocolDecoder.java index 56b53cb38..345c1aea3 100644 --- a/src/org/traccar/protocol/SkypatrolProtocolDecoder.java +++ b/src/org/traccar/protocol/SkypatrolProtocolDecoder.java @@ -92,15 +92,15 @@ public class SkypatrolProtocolDecoder extends BaseProtocolDecoder { position.setDeviceId(deviceSession.getDeviceId()); if (BitUtil.check(mask, 3)) { - position.set(Position.PREFIX_IO + 1, buf.readUnsignedShort()); // io data + position.set(Position.PREFIX_IO + 1, buf.readUnsignedShort()); } if (BitUtil.check(mask, 4)) { - position.set(Position.PREFIX_ADC + 1, buf.readUnsignedShort()); // adc 1 + position.set(Position.PREFIX_ADC + 1, buf.readUnsignedShort()); } if (BitUtil.check(mask, 5)) { - position.set(Position.PREFIX_ADC + 2, buf.readUnsignedShort()); // adc 2 + position.set(Position.PREFIX_ADC + 2, buf.readUnsignedShort()); } if (BitUtil.check(mask, 7)) { @@ -150,7 +150,7 @@ public class SkypatrolProtocolDecoder extends BaseProtocolDecoder { } if (BitUtil.check(mask, 17)) { - position.set(Position.KEY_BATTERY, buf.readUnsignedShort()); // battery percentage + position.set(Position.KEY_BATTERY, buf.readUnsignedShort()); } if (BitUtil.check(mask, 20)) { diff --git a/src/org/traccar/protocol/SmokeyProtocolDecoder.java b/src/org/traccar/protocol/SmokeyProtocolDecoder.java index 6ac92f158..2dcfeb86f 100644 --- a/src/org/traccar/protocol/SmokeyProtocolDecoder.java +++ b/src/org/traccar/protocol/SmokeyProtocolDecoder.java @@ -88,7 +88,7 @@ public class SmokeyProtocolDecoder extends BaseProtocolDecoder { position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); - position.set(Position.KEY_VERSION_FW, buf.readUnsignedShort()); // firmware version + position.set(Position.KEY_VERSION_FW, buf.readUnsignedShort()); int status = buf.readUnsignedShort(); position.set(Position.KEY_STATUS, status); diff --git a/src/org/traccar/protocol/TrakMateProtocolDecoder.java b/src/org/traccar/protocol/TrakMateProtocolDecoder.java index c9aa9ea42..95eef67c8 100644 --- a/src/org/traccar/protocol/TrakMateProtocolDecoder.java +++ b/src/org/traccar/protocol/TrakMateProtocolDecoder.java @@ -126,7 +126,7 @@ public class TrakMateProtocolDecoder extends BaseProtocolDecoder { position.setTime(dateBuilder.getDate()); position.set(Position.KEY_VERSION_FW, parser.next()); - position.set(Position.KEY_VERSION_HW, parser.next()); // hardware version + position.set(Position.KEY_VERSION_HW, parser.next()); return position; } @@ -195,13 +195,13 @@ public class TrakMateProtocolDecoder extends BaseProtocolDecoder { position.setCourse(parser.nextDouble()); position.set(Position.KEY_IGNITION, parser.nextInt() == 1); - position.set("dop1", parser.next()); // dop1 - position.set("dop2", parser.next()); // dop2 - position.set(Position.KEY_INPUT, parser.next()); // analog input - position.set(Position.KEY_BATTERY, parser.nextDouble()); // device battery voltage - position.set(Position.KEY_POWER, parser.next()); // vehicle internal voltage - position.set(Position.KEY_ODOMETER, parser.nextDouble()); // gps odometer - position.set("pulseOdometer", parser.next()); // pulse odometer + position.set("dop1", parser.next()); + position.set("dop2", parser.next()); + position.set(Position.KEY_INPUT, parser.next()); + position.set(Position.KEY_BATTERY, parser.nextDouble()); + position.set(Position.KEY_POWER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextDouble()); + position.set("pulseOdometer", parser.next()); position.set(Position.KEY_STATUS, parser.nextInt()); position.setValid(parser.nextInt() != 0); diff --git a/src/org/traccar/protocol/TramigoProtocolDecoder.java b/src/org/traccar/protocol/TramigoProtocolDecoder.java index 8e14debd4..8a6f49ef0 100644 --- a/src/org/traccar/protocol/TramigoProtocolDecoder.java +++ b/src/org/traccar/protocol/TramigoProtocolDecoder.java @@ -82,19 +82,19 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(buf.readUnsignedInt() * 0.0000001); position.setLongitude(buf.readUnsignedInt() * 0.0000001); - position.set(Position.KEY_RSSI, buf.readUnsignedShort()); // GSM signal quality - position.set(Position.KEY_SATELLITES, buf.readUnsignedShort()); // satellites in fix - position.set(Position.KEY_SATELLITES_VISIBLE, buf.readUnsignedShort()); // satellites in track - position.set("gpsAntennaStatus", buf.readUnsignedShort()); // GPS antenna state + position.set(Position.KEY_RSSI, buf.readUnsignedShort()); + position.set(Position.KEY_SATELLITES, buf.readUnsignedShort()); + position.set(Position.KEY_SATELLITES_VISIBLE, buf.readUnsignedShort()); + position.set("gpsAntennaStatus", buf.readUnsignedShort()); position.setSpeed(buf.readUnsignedShort() * 0.194384); position.setCourse((double) buf.readUnsignedShort()); - position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); // distance + position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); position.set(Position.KEY_BATTERY, buf.readUnsignedShort()); - position.set(Position.KEY_CHARGE, buf.readUnsignedShort()); // battery charger status + position.set(Position.KEY_CHARGE, buf.readUnsignedShort()); position.setTime(new Date(buf.readUnsignedInt() * 1000)); diff --git a/src/org/traccar/protocol/TzoneProtocolDecoder.java b/src/org/traccar/protocol/TzoneProtocolDecoder.java index 7dc158579..69aa916df 100644 --- a/src/org/traccar/protocol/TzoneProtocolDecoder.java +++ b/src/org/traccar/protocol/TzoneProtocolDecoder.java @@ -119,8 +119,8 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder { if (buf.readUnsignedShort() != 0x2424) { return null; } - int hardware = buf.readUnsignedShort(); // model - long firmware = buf.readUnsignedInt(); // firmware + int hardware = buf.readUnsignedShort(); + long firmware = buf.readUnsignedInt(); String imei = ChannelBuffers.hexDump(buf.readBytes(8)).substring(1); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, imei); @@ -202,10 +202,10 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder { if (blockLength >= 13) { position.set(Position.KEY_ALARM, decodeAlarm(buf.readUnsignedByte())); - position.set("terminalInfo", buf.readUnsignedByte()); // terminal info + position.set("terminalInfo", buf.readUnsignedByte()); position.set(Position.PREFIX_IO + 1, buf.readUnsignedShort()); position.set(Position.KEY_RSSI, buf.readUnsignedByte()); - position.set("gsmStatus", buf.readUnsignedByte()); // GSM status + position.set("gsmStatus", buf.readUnsignedByte()); position.set(Position.KEY_BATTERY, buf.readUnsignedShort()); position.set(Position.KEY_POWER, buf.readUnsignedShort()); position.set(Position.PREFIX_ADC + 1, buf.readUnsignedShort()); |