aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-04-11 10:52:42 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-04-11 10:52:42 +1200
commit807eb5398e5e9a6ab827a576cb94e904f509bda5 (patch)
tree61246b151efbe987ce21444374807e6d192c1691 /src/org/traccar/ServerManager.java
parent761eb81bc2fcc7f3abf6817209e244cb276446e1 (diff)
downloadtrackermap-server-807eb5398e5e9a6ab827a576cb94e904f509bda5.tar.gz
trackermap-server-807eb5398e5e9a6ab827a576cb94e904f509bda5.tar.bz2
trackermap-server-807eb5398e5e9a6ab827a576cb94e904f509bda5.zip
Add support for MTX protocol
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r--src/org/traccar/ServerManager.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 238cd808e..28cbac34d 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -183,6 +183,7 @@ public class ServerManager {
initBceServer("bce");
initXirgoServer("xirgo");
initCalAmpServer("calamp");
+ initMtxServer("mtx");
initProtocolDetector();
@@ -1365,4 +1366,18 @@ public class ServerManager {
}
}
+ private void initMtxServer(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 LineBasedFrameDecoder(1024));
+ pipeline.addLast("stringDecoder", new StringDecoder());
+ pipeline.addLast("stringEncoder", new StringEncoder());
+ pipeline.addLast("objectDecoder", new MtxProtocolDecoder(dataManager, protocol, properties));
+ }
+ });
+ }
+ }
+
}