diff options
-rw-r--r-- | src/org/traccar/protocol/WatchProtocolDecoder.java | 8 | ||||
-rw-r--r-- | test/org/traccar/protocol/WatchProtocolDecoderTest.java | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/WatchProtocolDecoder.java b/src/org/traccar/protocol/WatchProtocolDecoder.java index a24d0a56b..92b7638fb 100644 --- a/src/org/traccar/protocol/WatchProtocolDecoder.java +++ b/src/org/traccar/protocol/WatchProtocolDecoder.java @@ -64,8 +64,8 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder { private void sendResponse(Channel channel, String manufacturer, String id, String content) { if (channel != null) { - channel.write( - String.format("[%s*%s*%04x*%s]", manufacturer, id, content.length(), content)); + channel.write(String.format( + "[%s*%s*%04x*%s]", manufacturer, id, content.length(), content)); } } @@ -138,6 +138,10 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder { return position; + } else if (type.equals("TKQ")) { + + sendResponse(channel, manufacturer, id, "TKQ"); + } return null; diff --git a/test/org/traccar/protocol/WatchProtocolDecoderTest.java b/test/org/traccar/protocol/WatchProtocolDecoderTest.java index 41af104dd..16074d36f 100644 --- a/test/org/traccar/protocol/WatchProtocolDecoderTest.java +++ b/test/org/traccar/protocol/WatchProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class WatchProtocolDecoderTest extends ProtocolDecoderTest { WatchProtocolDecoder decoder = new WatchProtocolDecoder(new WatchProtocol()); + verifyNothing(decoder, text( + "[3G*8800000015*0003*TKQ")); + verifyPosition(decoder, text( "[3G*4700186508*00B1*UD,301015,084840,V,45.853100,N,14.6224899,E,0.00,0.0,0.0,0,84,61,0,11,00000008,7,255,293,70,60,6453,139,60,6432,139,60,6431,132,60,6457,127,60,16353,126,60,6451,121,60,16352,118")); |