diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2014-09-10 22:49:18 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2014-09-10 22:49:18 +1200 |
commit | 4f01c0906b74a9926d83befca46f8f6512730ec9 (patch) | |
tree | 2a0f0c03b3e5dccaf5ab3df9525672ffd1a98f09 /src/org/traccar/ServerManager.java | |
parent | 026f089951f03931138a1c6171699fcb9156da9c (diff) | |
download | trackermap-server-4f01c0906b74a9926d83befca46f8f6512730ec9.tar.gz trackermap-server-4f01c0906b74a9926d83befca46f8f6512730ec9.tar.bz2 trackermap-server-4f01c0906b74a9926d83befca46f8f6512730ec9.zip |
Implement Riti protocol
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 1d6dc633f..448b7685e 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -174,6 +174,7 @@ public class ServerManager { initTrackboxServer("trackbox"); initVisiontekServer("visiontek"); initOrionServer("orion"); + initRitiServer("riti"); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -1251,4 +1252,18 @@ public class ServerManager { } } + private void initRitiServer(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, 105, 2, 3, 0)); + pipeline.addLast("objectDecoder", new RitiProtocolDecoder(ServerManager.this)); + } + }; + server.setEndianness(ByteOrder.LITTLE_ENDIAN); + serverList.add(server); + } + } + } |