diff options
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r-- | src/org/traccar/ServerManager.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 4c9645e41..5e549b177 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -124,6 +124,7 @@ public class ServerManager { initCalAmpServer("calamp"); initMtxServer("mtx"); initTytanServer("tytan"); + initAvl301Server("avl301"); initProtocolDetector(); } @@ -1303,4 +1304,16 @@ public class ServerManager { } } + private void initAvl301Server(final String protocol) throws SQLException { + if (isProtocolEnabled(protocol)) { + serverList.add(new TrackerServer(new ServerBootstrap(), protocol) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(256, 2, 1, 2, 0)); + pipeline.addLast("objectDecoder", new Avl301ProtocolDecoder(protocol)); + } + }); + } + } + } |