aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-09-04 03:55:55 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-09-04 03:55:55 +1200
commit9379a48aee811cf6fe467581778c07ee253c195f (patch)
treeb9a9ec69a060b76bdd3b5cf4cd27ffe73f8e2678
parent1c807549e315d04054b4803518d2624591976324 (diff)
downloadtrackermap-server-9379a48aee811cf6fe467581778c07ee253c195f.tar.gz
trackermap-server-9379a48aee811cf6fe467581778c07ee253c195f.tar.bz2
trackermap-server-9379a48aee811cf6fe467581778c07ee253c195f.zip
Implement proper TRV response
-rw-r--r--src/org/traccar/protocol/TrvProtocolDecoder.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/TrvProtocolDecoder.java b/src/org/traccar/protocol/TrvProtocolDecoder.java
index 88ac76134..1783bce73 100644
--- a/src/org/traccar/protocol/TrvProtocolDecoder.java
+++ b/src/org/traccar/protocol/TrvProtocolDecoder.java
@@ -84,11 +84,14 @@ public class TrvProtocolDecoder extends BaseProtocolDecoder {
String type = sentence.substring(id.length(), id.length() + 4);
if (channel != null) {
+ String responseHeader = id + (char) (type.charAt(0) + 1) + type.substring(1);
if (type.equals("AP00") && id.equals("IW")) {
String time = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
- channel.write(id + (char) (type.charAt(0) + 1) + type.substring(1) + "," + time + ",0#");
+ channel.write(responseHeader + "," + time + ",0#");
+ } else if (type.equals("AP14")) {
+ channel.write(responseHeader + ",0.000,0.000#");
} else {
- channel.write(id + (char) (type.charAt(0) + 1) + type.substring(1) + "#");
+ channel.write(responseHeader + "#");
}
}