diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-04-26 20:45:17 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-04-26 20:45:17 +1200 |
commit | 1e1e738dbf3f72e3c06aa7e89f980aaf50740625 (patch) | |
tree | 74386a4cd232cfb6648c5635d14ab451c2bcb3c2 /src/org/traccar/ServerManager.java | |
parent | 1cd60e56770fd3643be9e3dd163198e8b84992a7 (diff) | |
download | traccar-server-1e1e738dbf3f72e3c06aa7e89f980aaf50740625.tar.gz traccar-server-1e1e738dbf3f72e3c06aa7e89f980aaf50740625.tar.bz2 traccar-server-1e1e738dbf3f72e3c06aa7e89f980aaf50740625.zip |
Add XT7 protocol support
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 48dd2ddc8..4a6682679 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -143,6 +143,7 @@ public class ServerManager { initYwtServer("ywt"); initTk102Server("tk102"); initIntellitracServer("intellitrac"); + initXt7Server("xt7"); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -798,4 +799,16 @@ public class ServerManager { } } + private void initXt7Server(String protocol) throws SQLException { + if (isProtocolEnabled(properties, protocol)) { + serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(256, 20, 1, 5, 0)); + pipeline.addLast("objectDecoder", new Xt7ProtocolDecoder(ServerManager.this)); + } + }); + } + } + } |