aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--default.cfg4
-rw-r--r--src/org/traccar/ServerManager.java16
2 files changed, 20 insertions, 0 deletions
diff --git a/default.cfg b/default.cfg
index d703c9936..9e0d9631c 100644
--- a/default.cfg
+++ b/default.cfg
@@ -338,4 +338,8 @@
<entry key='trackbox.enable'>true</entry>
<entry key='trackbox.port'>5068</entry>
+ <!-- Visiontek server configuration -->
+ <entry key='visiontek.enable'>true</entry>
+ <entry key='visiontek.port'>5069</entry>
+
</properties>
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));
+ }
+ });
+ }
+ }
+
}