diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-05-17 08:00:49 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-05-17 08:00:49 +1200 |
commit | 51542a55b769cb82cdc04ad7119632b9561478f3 (patch) | |
tree | 29994f4f64907af60547b38b41ad2f02ca681fd2 | |
parent | 1306899a67b28ad9cc0e6467291f3c8597df5479 (diff) | |
download | trackermap-server-51542a55b769cb82cdc04ad7119632b9561478f3.tar.gz trackermap-server-51542a55b769cb82cdc04ad7119632b9561478f3.tar.bz2 trackermap-server-51542a55b769cb82cdc04ad7119632b9561478f3.zip |
Add Watch heart message (fix #3171)
-rw-r--r-- | src/org/traccar/protocol/WatchProtocolDecoder.java | 2 | ||||
-rw-r--r-- | test/org/traccar/protocol/WatchProtocolDecoderTest.java | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/WatchProtocolDecoder.java b/src/org/traccar/protocol/WatchProtocolDecoder.java index dbd5072e7..437cf3407 100644 --- a/src/org/traccar/protocol/WatchProtocolDecoder.java +++ b/src/org/traccar/protocol/WatchProtocolDecoder.java @@ -206,7 +206,7 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder { sendResponse(channel, manufacturer, id, "TKQ"); - } else if (type.equals("PULSE")) { + } else if (type.equals("PULSE") || type.equals("heart")) { Position position = new Position(); position.setProtocol(getProtocolName()); diff --git a/test/org/traccar/protocol/WatchProtocolDecoderTest.java b/test/org/traccar/protocol/WatchProtocolDecoderTest.java index 9f402cef2..a1b9e458a 100644 --- a/test/org/traccar/protocol/WatchProtocolDecoderTest.java +++ b/test/org/traccar/protocol/WatchProtocolDecoderTest.java @@ -69,6 +69,12 @@ public class WatchProtocolDecoderTest extends ProtocolTest { verifyAttributes(decoder, text( "[CS*8800000015*0008*PULSE,72")); + verifyAttributes(decoder, text( + "[3G*6005412902*0007*heart,0")); + + verifyAttributes(decoder, text( + "[3G*6005412902*0008*heart,71")); + } } |