aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Server.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/Server.java')
-rw-r--r--src/org/traccar/Server.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/org/traccar/Server.java b/src/org/traccar/Server.java
index a6b0a67da..81a1988d1 100644
--- a/src/org/traccar/Server.java
+++ b/src/org/traccar/Server.java
@@ -90,6 +90,7 @@ public class Server {
initXexun2Server(properties);
initAvl08Server(properties);
initEnforaServer(properties);
+ initMeiligaoServer(properties);
// Initialize web server
if (Boolean.valueOf(properties.getProperty("http.enable"))) {
@@ -416,4 +417,26 @@ public class Server {
}
}
+ /**
+ * Init Meiligao server
+ */
+ public void initMeiligaoServer(Properties properties) throws SQLException {
+
+ String protocol = "meiligao";
+ if (isProtocolEnabled(properties, protocol)) {
+
+ TrackerServer server = new TrackerServer(getProtocolPort(properties, protocol));
+ final Integer resetDelay = getProtocolResetDelay(properties, protocol);
+
+ server.setPipelineFactory(new GenericPipelineFactory(server, dataManager, isLoggerEnabled()) {
+ protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, -4, 4));
+ pipeline.addLast("objectDecoder", new MeiligaoProtocolDecoder(getDataManager(), resetDelay));
+ }
+ });
+
+ serverList.add(server);
+ }
+ }
+
}