diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-06-03 16:12:35 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-06-03 16:12:35 +1200 |
commit | 3ae842837ddc8b0070a726d4e25cb700d30f286b (patch) | |
tree | 823f54e823aa5e50fe622d1c9f2a7489f08fcf15 /src/org/traccar/ServerManager.java | |
parent | 35033a6176e06d14c9fc7118f1320d01ede6ac89 (diff) | |
download | traccar-server-3ae842837ddc8b0070a726d4e25cb700d30f286b.tar.gz traccar-server-3ae842837ddc8b0070a726d4e25cb700d30f286b.tar.bz2 traccar-server-3ae842837ddc8b0070a726d4e25cb700d30f286b.zip |
Start GlobalSat decoder
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 b1c6d186a..afb6fa60a 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -149,6 +149,7 @@ public class ServerManager { initCarscopServer("carscop"); initApelServer("apel"); initManPowerServer("manpower"); + initGlobalSatServer("globalsat"); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -874,4 +875,20 @@ public class ServerManager { } } + private void initGlobalSatServer(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) '!' }; + pipeline.addLast("frameDecoder", + new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("stringEncoder", new StringEncoder()); + pipeline.addLast("objectDecoder", new GlobalSatProtocolDecoder(ServerManager.this)); + } + }); + } + } + } |