From faeecdffcf78783ee030d0f9060e1f7656f9f707 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 30 Dec 2014 15:38:35 +1300 Subject: Start Tramigo implementation --- src/org/traccar/ServerManager.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/org/traccar/ServerManager.java') diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 71b71975e..f6504fd27 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -177,6 +177,7 @@ public class ServerManager { initOrionServer("orion"); initRitiServer("riti"); initUlbotechServer("ulbotech"); + initTramigoServer("tramigo"); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -1273,6 +1274,9 @@ public class ServerManager { } private void initUlbotechServer(final String protocol) throws SQLException { + + // TODO: Waiting for feedback from manufacturer + if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -1284,4 +1288,16 @@ public class ServerManager { } } + private void initTramigoServer(final 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(1024, 6, 2, -8, 0)); + pipeline.addLast("objectDecoder", new TramigoProtocolDecoder(dataManager, protocol, properties)); + } + }); + } + } + } -- cgit v1.2.3