diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-05-15 22:18:04 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-05-15 22:18:04 +1200 |
commit | b3d221372103a677002428a57686b61e3facf32c (patch) | |
tree | 494b2df06aaa1fd675e48bb16cf74fe5f77bafb4 /src/org/traccar/ServerManager.java | |
parent | 14b7897b6df25a144da1a329f4a088b52a01571b (diff) | |
download | trackermap-server-b3d221372103a677002428a57686b61e3facf32c.tar.gz trackermap-server-b3d221372103a677002428a57686b61e3facf32c.tar.bz2 trackermap-server-b3d221372103a677002428a57686b61e3facf32c.zip |
Initial apel support
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r-- | src/org/traccar/ServerManager.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index ac97da4f2..971859099 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -147,6 +147,7 @@ public class ServerManager { initXt7Server("xt7"); initWialonServer("wialon"); initCarscopServer("carscop"); + initApelServer("apel"); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -842,4 +843,18 @@ public class ServerManager { } } + private void initApelServer(String protocol) throws SQLException { + if (isProtocolEnabled(properties, protocol)) { + TrackerServer server = new TrackerServer(this, new ServerBootstrap(), protocol) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, 4, 0)); + pipeline.addLast("objectDecoder", new ApelProtocolDecoder(ServerManager.this)); + } + }; + server.setEndianness(ByteOrder.LITTLE_ENDIAN); + serverList.add(server); + } + } + } |