diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-09-10 00:08:35 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-10 00:08:35 +1200 |
commit | d62941c0bf39c6c9d7f31e5048306ec1b1908e85 (patch) | |
tree | af6119c309410a5724d01ab79ca9906c3476d1c3 /src | |
parent | 9bbb70a0eb76bd81c494c410772a31f19d6fd584 (diff) | |
parent | 91cc83f8d09f7ee591c9109e61cee6492226a612 (diff) | |
download | traccar-server-d62941c0bf39c6c9d7f31e5048306ec1b1908e85.tar.gz traccar-server-d62941c0bf39c6c9d7f31e5048306ec1b1908e85.tar.bz2 traccar-server-d62941c0bf39c6c9d7f31e5048306ec1b1908e85.zip |
Merge pull request #2297 from Abyss777/watch_pulse
Handle Watch answer on pulse command
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/WatchProtocolDecoder.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/WatchProtocolDecoder.java b/src/org/traccar/protocol/WatchProtocolDecoder.java index 326552e7f..d74fdbe81 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,18 @@ 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); + String pulse = content.substring(1); + position.set("pulse", pulse); + position.set(Position.KEY_RESULT, pulse); + return position; + } return null; |