diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-04-13 01:02:17 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-04-13 01:02:17 +1200 |
commit | 570cd3cbd9290df1388eb8be6e4b2636afc33951 (patch) | |
tree | b711bcd6d7b9e53a85346d7687092463073232b5 /src/org/traccar/ServerManager.java | |
parent | 744b95cca3250c8848af1ad75e0dc4c70e39d4dc (diff) | |
download | traccar-server-570cd3cbd9290df1388eb8be6e4b2636afc33951.tar.gz traccar-server-570cd3cbd9290df1388eb8be6e4b2636afc33951.tar.bz2 traccar-server-570cd3cbd9290df1388eb8be6e4b2636afc33951.zip |
Add IntelliTrac protocol support
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 18535307c..34c903cc5 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -142,6 +142,7 @@ public class ServerManager { initGalileoServer("galileo"); initYwtServer("ywt"); initTk102Server("tk102"); + initIntellitracServer("intellitrac"); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -780,5 +781,21 @@ public class ServerManager { }); } } + + private void initIntellitracServer(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 IntellitracProtocolDecoder(ServerManager.this)); + } + }); + } + } } |