diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-03-17 15:12:52 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-03-17 15:12:52 +1300 |
commit | 91436e6a790b6c01c7af7d6c73c8783896c6cd87 (patch) | |
tree | b8798424e3167a6ba48c788e528524fffe35bfc3 /src/org/traccar/ServerManager.java | |
parent | 8db1cf2bc97f5f616bd5722656db2d69edd46d45 (diff) | |
download | trackermap-server-91436e6a790b6c01c7af7d6c73c8783896c6cd87.tar.gz trackermap-server-91436e6a790b6c01c7af7d6c73c8783896c6cd87.tar.bz2 trackermap-server-91436e6a790b6c01c7af7d6c73c8783896c6cd87.zip |
Add VT300 protocol
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 a8f8a742f..bf6e7afca 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -137,6 +137,7 @@ public class ServerManager { initMta6CanServer("mta6can"); initTlt2hServer("tlt2h"); initSyrusServer("syrus"); + initVt300Server("vt300"); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -700,4 +701,20 @@ public class ServerManager { } } + private void initVt300Server(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) '\r', (byte) '\n' }; + pipeline.addLast("frameDecoder", + new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("stringEncoder", new StringEncoder()); + pipeline.addLast("objectDecoder", new Vt300ProtocolDecoder(ServerManager.this)); + } + }); + } + } + } |