aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-08-18 00:54:12 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2014-08-18 00:54:12 +1200
commit4d62f1b57100c95dcc62a72362978cd544c987c7 (patch)
tree84709a6846480a7edcbb59b31e07ca2fd63be2e0 /src/org/traccar
parent600aca2812a3fef2480ac55c0587676cef79246f (diff)
downloadtrackermap-server-4d62f1b57100c95dcc62a72362978cd544c987c7.tar.gz
trackermap-server-4d62f1b57100c95dcc62a72362978cd544c987c7.tar.bz2
trackermap-server-4d62f1b57100c95dcc62a72362978cd544c987c7.zip
Implement Visiontek protocol (fix #802)
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/ServerManager.java16
1 files changed, 16 insertions, 0 deletions
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));
+ }
+ });
+ }
+ }
+
}