diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-02-10 13:08:35 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-02-10 13:08:35 +1300 |
commit | 8f6f1aae2afb02ac9de3577798fc2e837f18a651 (patch) | |
tree | e4b29511985fdbcf370dba5bb0f7d3ba54e28a64 /src/org/traccar/ServerManager.java | |
parent | 8a1ecff3518bcbe1a1700c119e7afd4cb106bbae (diff) | |
download | trackermap-server-8f6f1aae2afb02ac9de3577798fc2e837f18a651.tar.gz trackermap-server-8f6f1aae2afb02ac9de3577798fc2e837f18a651.tar.bz2 trackermap-server-8f6f1aae2afb02ac9de3577798fc2e837f18a651.zip |
Added TLT-2H protocol support
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r-- | src/org/traccar/ServerManager.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 7f73dd019..a79714a8d 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -135,6 +135,7 @@ public class ServerManager { initTeltonikaServer("teltonika"); initMta6Server("mta6"); initMta6CanServer("mta6can"); + initTlt2hServer("tlt2h"); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -665,5 +666,21 @@ public class ServerManager { }); } } + + private void initTlt2hServer(String protocol) throws SQLException { + if (isProtocolEnabled(properties, protocol)) { + serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + byte delimiter[] = { (byte) '#', (byte) '#' }; + pipeline.addLast("frameDecoder", + new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("stringEncoder", new StringEncoder()); + pipeline.addLast("objectDecoder", new Tlt2hProtocolDecoder(ServerManager.this)); + } + }); + } + } } |