aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorjon-stumpf <jon.stumpf@gmail.com>2017-03-04 17:15:40 -0500
committerjon-stumpf <jon.stumpf@gmail.com>2017-03-04 17:17:44 -0500
commit525db3566a9e17f626d34e498c85e02d382d6655 (patch)
tree4fd160372e81e76e775253b038d8e3056e0891dd /src/org
parentaa1668df74c2d3c9a5d624d571f95bc110ad5414 (diff)
downloadtrackermap-server-525db3566a9e17f626d34e498c85e02d382d6655.tar.gz
trackermap-server-525db3566a9e17f626d34e498c85e02d382d6655.tar.bz2
trackermap-server-525db3566a9e17f626d34e498c85e02d382d6655.zip
Added Position.KEY_COMMAND;
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/model/Position.java1
-rw-r--r--src/org/traccar/protocol/CarTrackProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/EasyTrackProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java3
-rw-r--r--src/org/traccar/protocol/RitiProtocolDecoder.java2
-rwxr-xr-xsrc/org/traccar/protocol/SupermateProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/TeltonikaProtocolDecoder.java2
7 files changed, 8 insertions, 6 deletions
diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java
index 409b49ccb..218b8a4e8 100644
--- a/src/org/traccar/model/Position.java
+++ b/src/org/traccar/model/Position.java
@@ -62,6 +62,7 @@ public class Position extends Message {
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_COMMAND = "command";
public static final String KEY_DTCS = "dtcs";
public static final String KEY_OBD_SPEED = "obdSpeed";
diff --git a/src/org/traccar/protocol/CarTrackProtocolDecoder.java b/src/org/traccar/protocol/CarTrackProtocolDecoder.java
index 94f5d208b..0952a0978 100644
--- a/src/org/traccar/protocol/CarTrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/CarTrackProtocolDecoder.java
@@ -74,7 +74,7 @@ public class CarTrackProtocolDecoder extends BaseProtocolDecoder {
}
position.setDeviceId(deviceSession.getDeviceId());
- position.set("command", parser.next());
+ position.set(Position.KEY_COMMAND, parser.next());
DateBuilder dateBuilder = new DateBuilder()
.setTime(parser.nextInt(), parser.nextInt(), parser.nextInt(), parser.nextInt());
diff --git a/src/org/traccar/protocol/EasyTrackProtocolDecoder.java b/src/org/traccar/protocol/EasyTrackProtocolDecoder.java
index 688629063..c4baad5ab 100644
--- a/src/org/traccar/protocol/EasyTrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/EasyTrackProtocolDecoder.java
@@ -77,7 +77,7 @@ public class EasyTrackProtocolDecoder extends BaseProtocolDecoder {
}
position.setDeviceId(deviceSession.getDeviceId());
- position.set("command", parser.next());
+ position.set(Position.KEY_COMMAND, parser.next());
position.setValid(parser.next().equals("A"));
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index 356097fb2..bbba639c1 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -264,7 +264,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
if (commandLength > 0) {
buf.readUnsignedByte(); // server flag (reserved)
- position.set("command", buf.readBytes(commandLength - 1).toString(StandardCharsets.US_ASCII));
+ position.set(Position.KEY_COMMAND,
+ buf.readBytes(commandLength - 1).toString(StandardCharsets.US_ASCII));
}
} else if (isSupported(type)) {
diff --git a/src/org/traccar/protocol/RitiProtocolDecoder.java b/src/org/traccar/protocol/RitiProtocolDecoder.java
index 26aeb40f3..7f81ef09c 100644
--- a/src/org/traccar/protocol/RitiProtocolDecoder.java
+++ b/src/org/traccar/protocol/RitiProtocolDecoder.java
@@ -66,7 +66,7 @@ public class RitiProtocolDecoder extends BaseProtocolDecoder {
position.setDeviceId(deviceSession.getDeviceId());
position.set("mode", buf.readUnsignedByte());
- position.set("command", buf.readUnsignedByte());
+ position.set(Position.KEY_COMMAND, buf.readUnsignedByte());
position.set(Position.KEY_POWER, buf.readUnsignedShort()); // mV
buf.skipBytes(5); // status
diff --git a/src/org/traccar/protocol/SupermateProtocolDecoder.java b/src/org/traccar/protocol/SupermateProtocolDecoder.java
index 7f12121bb..5e6615e9f 100755
--- a/src/org/traccar/protocol/SupermateProtocolDecoder.java
+++ b/src/org/traccar/protocol/SupermateProtocolDecoder.java
@@ -82,7 +82,7 @@ public class SupermateProtocolDecoder extends BaseProtocolDecoder {
position.setDeviceId(deviceSession.getDeviceId());
position.set("commandId", parser.next());
- position.set("command", parser.next());
+ position.set(Position.KEY_COMMAND, parser.next());
position.setValid(parser.next().equals("A"));
diff --git a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
index 77211b7ab..e55d354cf 100644
--- a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
+++ b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
@@ -67,7 +67,7 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_TYPE, buf.readUnsignedByte());
- position.set("command", buf.readBytes(buf.readInt()).toString(StandardCharsets.US_ASCII));
+ position.set(Position.KEY_COMMAND, buf.readBytes(buf.readInt()).toString(StandardCharsets.US_ASCII));
}