aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-05-29 22:11:59 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2013-05-29 22:11:59 +1200
commit56d8564104aaa79e166c4fbe5f8147fc01e7b1ba (patch)
treed083c3e648d26639faf18c75b61c4b01884e9da7 /src/org/traccar/ServerManager.java
parent76ab97612a13e6d89b45596372fb311a3dafa826 (diff)
downloadtrackermap-server-56d8564104aaa79e166c4fbe5f8147fc01e7b1ba.tar.gz
trackermap-server-56d8564104aaa79e166c4fbe5f8147fc01e7b1ba.tar.bz2
trackermap-server-56d8564104aaa79e166c4fbe5f8147fc01e7b1ba.zip
Support Map Power protocol (fix #225)
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r--src/org/traccar/ServerManager.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 62de6bf0b..b1c6d186a 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -148,6 +148,7 @@ public class ServerManager {
initWialonServer("wialon");
initCarscopServer("carscop");
initApelServer("apel");
+ initManPowerServer("manpower");
// Initialize web server
if (Boolean.valueOf(properties.getProperty("http.enable"))) {
@@ -857,4 +858,20 @@ public class ServerManager {
}
}
+ private void initManPowerServer(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("stringEncoder", new StringEncoder());
+ pipeline.addLast("objectDecoder", new ManPowerProtocolDecoder(ServerManager.this));
+ }
+ });
+ }
+ }
+
}