From 4d62f1b57100c95dcc62a72362978cd544c987c7 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 18 Aug 2014 00:54:12 +1200 Subject: Implement Visiontek protocol (fix #802) --- src/org/traccar/ServerManager.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/org/traccar') diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 01f78c515..c262de360 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -172,6 +172,7 @@ public class ServerManager { initFreedomServer("freedom"); initTelikServer("telik"); initTrackboxServer("trackbox"); + initVisiontekServer("visiontek"); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -1204,4 +1205,19 @@ public class ServerManager { } } + private void initVisiontekServer(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) '#' }; + pipeline.addLast("frameDecoder", + new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("objectDecoder", new VisiontekProtocolDecoder(ServerManager.this)); + } + }); + } + } + } -- cgit v1.2.3