diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-05-23 21:39:23 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-05-23 21:39:23 +1200 |
commit | 23d502088fc76990687d4363099a7b92d1cf7d21 (patch) | |
tree | aa7715dba501512b30b5220aff7eff190bdb1b7e /src/org/traccar/protocol/Tk103Protocol.java | |
parent | 284f2835b4ab9a1a921eb431c2884eeed897dea8 (diff) | |
download | trackermap-server-23d502088fc76990687d4363099a7b92d1cf7d21.tar.gz trackermap-server-23d502088fc76990687d4363099a7b92d1cf7d21.tar.bz2 trackermap-server-23d502088fc76990687d4363099a7b92d1cf7d21.zip |
Implement TK103 engine commands
Diffstat (limited to 'src/org/traccar/protocol/Tk103Protocol.java')
-rw-r--r-- | src/org/traccar/protocol/Tk103Protocol.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Tk103Protocol.java b/src/org/traccar/protocol/Tk103Protocol.java index 1520e88f6..6fc00195e 100644 --- a/src/org/traccar/protocol/Tk103Protocol.java +++ b/src/org/traccar/protocol/Tk103Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; +import org.traccar.model.Command; import java.util.List; @@ -30,6 +31,9 @@ public class Tk103Protocol extends BaseProtocol { public Tk103Protocol() { super("tk103"); + setSupportedDataCommands( + Command.TYPE_ENGINE_STOP, + Command.TYPE_ENGINE_RESUME); } @Override @@ -40,6 +44,7 @@ public class Tk103Protocol extends BaseProtocol { pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, ')')); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); + pipeline.addLast("objectEncoder", new Tk103ProtocolEncoder()); pipeline.addLast("objectDecoder", new Tk103ProtocolDecoder(Tk103Protocol.this)); } }); @@ -48,6 +53,7 @@ public class Tk103Protocol extends BaseProtocol { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); + pipeline.addLast("objectEncoder", new Tk103ProtocolEncoder()); pipeline.addLast("objectDecoder", new Tk103ProtocolDecoder(Tk103Protocol.this)); } }); |