aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol')
-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 + "#");
}
}