From 2d6adb7ba45ae0668e0084e85441ad275ebfb7eb Mon Sep 17 00:00:00 2001 From: jon-stumpf Date: Sat, 25 Feb 2017 21:01:18 -0500 Subject: Added Position.KEY_OPERATOR and updated protocols accordingly; --- src/org/traccar/model/Position.java | 1 + src/org/traccar/protocol/CellocatorProtocolDecoder.java | 2 +- src/org/traccar/protocol/TeltonikaProtocolDecoder.java | 2 +- src/org/traccar/protocol/TmgProtocolDecoder.java | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/org/traccar') diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java index 96dc1d2ad..54c97c373 100644 --- a/src/org/traccar/model/Position.java +++ b/src/org/traccar/model/Position.java @@ -61,6 +61,7 @@ public class Position extends Message { public static final String KEY_GEOFENCE = "geofence"; public static final String KEY_ACCELERATION = "acceleration"; public static final String KEY_DEVICE_TEMP = "deviceTemp"; + public static final String KEY_OPERATOR = "operator"; public static final String KEY_DTCS = "dtcs"; public static final String KEY_OBD_SPEED = "obdSpeed"; diff --git a/src/org/traccar/protocol/CellocatorProtocolDecoder.java b/src/org/traccar/protocol/CellocatorProtocolDecoder.java index c0f871f80..ce43cce37 100644 --- a/src/org/traccar/protocol/CellocatorProtocolDecoder.java +++ b/src/org/traccar/protocol/CellocatorProtocolDecoder.java @@ -126,7 +126,7 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder { operator <<= 8; operator += buf.readUnsignedByte(); - position.set("operator", operator); + position.set(Position.KEY_OPERATOR, operator); position.set(Position.PREFIX_ADC + 1, buf.readUnsignedInt()); // ADC position.set(Position.KEY_ODOMETER, buf.readUnsignedMedium()); // Odometer diff --git a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java index a9679f764..77211b7ab 100644 --- a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java +++ b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java @@ -178,7 +178,7 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder { } if (BitUtil.check(locationMask, 7)) { - position.set("operator", buf.readUnsignedInt()); + position.set(Position.KEY_OPERATOR, buf.readUnsignedInt()); } } else { diff --git a/src/org/traccar/protocol/TmgProtocolDecoder.java b/src/org/traccar/protocol/TmgProtocolDecoder.java index 40ce04c5b..a0459a161 100644 --- a/src/org/traccar/protocol/TmgProtocolDecoder.java +++ b/src/org/traccar/protocol/TmgProtocolDecoder.java @@ -129,7 +129,7 @@ public class TmgProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_HDOP, parser.nextDouble()); position.set(Position.KEY_SATELLITES, parser.nextInt()); position.set(Position.KEY_SATELLITES_VISIBLE, parser.nextInt()); - position.set("operator", parser.next()); + position.set(Position.KEY_OPERATOR, parser.next()); position.set(Position.KEY_RSSI, parser.nextInt()); position.set(Position.KEY_IGNITION, parser.nextInt() == 1); position.set(Position.KEY_BATTERY, parser.nextDouble()); -- cgit v1.2.3