aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/WatchProtocolDecoder.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-09-09 15:32:20 +0500
committerAbyss777 <abyss@fox5.ru>2016-09-09 15:32:20 +0500
commitb4185cbf84bdff2927f7d9a8b0cde9f4ea889353 (patch)
treebc86fe5b97d21f0a89eecaedc66fa5a64431b1bc /src/org/traccar/protocol/WatchProtocolDecoder.java
parent0edf8b90483691d77438748f203d3d03f034781e (diff)
downloadtrackermap-server-b4185cbf84bdff2927f7d9a8b0cde9f4ea889353.tar.gz
trackermap-server-b4185cbf84bdff2927f7d9a8b0cde9f4ea889353.tar.bz2
trackermap-server-b4185cbf84bdff2927f7d9a8b0cde9f4ea889353.zip
Store pulse for watch protocol
Diffstat (limited to 'src/org/traccar/protocol/WatchProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/WatchProtocolDecoder.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/WatchProtocolDecoder.java b/src/org/traccar/protocol/WatchProtocolDecoder.java
index 326552e7f..488d05a3c 100644
--- a/src/org/traccar/protocol/WatchProtocolDecoder.java
+++ b/src/org/traccar/protocol/WatchProtocolDecoder.java
@@ -25,6 +25,7 @@ import org.traccar.helper.UnitsConverter;
import org.traccar.model.Position;
import java.net.SocketAddress;
+import java.util.Date;
import java.util.regex.Pattern;
public class WatchProtocolDecoder extends BaseProtocolDecoder {
@@ -146,6 +147,16 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder {
sendResponse(channel, manufacturer, id, "TKQ");
+ } else if (type.equals("PULSE")) {
+
+ Position position = new Position();
+ position.setProtocol(getProtocolName());
+ position.setDeviceId(deviceSession.getDeviceId());
+ getLastLocation(position, new Date());
+ position.setValid(false);
+ position.set("pulse", content.split(",")[1]);
+ return position;
+
}
return null;