aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-05-21 21:20:45 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2014-05-21 21:20:45 +1200
commit7b37d4f85a5a2c751f26860ccdb700e3ba42644a (patch)
treee380f62e83fd541aa9c7c66dcf67607ea6226195 /src/org/traccar/ServerManager.java
parente5549d271325639bae97dc3591ff09bf271cf43c (diff)
downloadtrackermap-server-7b37d4f85a5a2c751f26860ccdb700e3ba42644a.tar.gz
trackermap-server-7b37d4f85a5a2c751f26860ccdb700e3ba42644a.tar.bz2
trackermap-server-7b37d4f85a5a2c751f26860ccdb700e3ba42644a.zip
Implement Haicom protocol
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-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 6d65dad18..b640462b0 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -166,6 +166,7 @@ public class ServerManager {
initStl060Server("stl060");
initCarTrackServer("cartrack");
initMiniFinderServer("minifinder");
+ initHaicomServer("haicom");
// Initialize web server
if (Boolean.valueOf(properties.getProperty("http.enable"))) {
@@ -1113,4 +1114,19 @@ public class ServerManager {
}
}
+ private void initHaicomServer(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 HaicomProtocolDecoder(ServerManager.this));
+ }
+ });
+ }
+ }
+
}