aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Server.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2012-12-17 22:57:05 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2012-12-17 22:57:05 +1300
commit34923934e0ee7d707aa9ffef2712942115236472 (patch)
tree1e213cce9e4544421cb0196dc8c4df5bcf98e9f7 /src/org/traccar/Server.java
parent1cde955eb9e506ec3a4cf4b3829d88b798d45175 (diff)
downloadtrackermap-server-34923934e0ee7d707aa9ffef2712942115236472.tar.gz
trackermap-server-34923934e0ee7d707aa9ffef2712942115236472.tar.bz2
trackermap-server-34923934e0ee7d707aa9ffef2712942115236472.zip
Improved progress decoder
Diffstat (limited to 'src/org/traccar/Server.java')
-rw-r--r--src/org/traccar/Server.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/org/traccar/Server.java b/src/org/traccar/Server.java
index 9deb271da..506513b60 100644
--- a/src/org/traccar/Server.java
+++ b/src/org/traccar/Server.java
@@ -111,6 +111,8 @@ public class Server {
initNavisServer(properties);
initMeitrackServer(properties);
initSkypatrolServer(properties);
+ initGt02Server(properties);
+ initGt06Server(properties);
// Initialize web server
if (Boolean.valueOf(properties.getProperty("http.enable"))) {
@@ -810,4 +812,36 @@ public class Server {
serverList.add(server);
}
}
+
+ /**
+ * Init GT02 server
+ */
+ private void initGt02Server(Properties properties) throws SQLException {
+
+ String protocol = "gt02";
+ if (isProtocolEnabled(properties, protocol)) {
+
+ TrackerServer server = new TrackerServer(new ServerBootstrap());
+ server.setPort(getProtocolPort(properties, protocol));
+ server.setAddress(getProtocolInterface(properties, protocol));
+ //server.setEndianness(ByteOrder.LITTLE_ENDIAN);
+ final Integer resetDelay = getProtocolResetDelay(properties, protocol);
+
+ server.setPipelineFactory(new GenericPipelineFactory(server, dataManager, isLoggerEnabled(), resetDelay, geocoder) {
+ protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(4 * 1024, 12, 2, 2, 0));
+ pipeline.addLast("objectDecoder", new NavisProtocolDecoder(getDataManager()));
+ }
+ });
+
+ serverList.add(server);
+ }
+ }
+
+ /**
+ * Init GT06 server
+ */
+ private void initGt06Server(Properties properties) throws SQLException {
+ }
+
}