aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Server.java
diff options
context:
space:
mode:
authoruser <user@laptop.(none)>2012-10-21 17:44:59 +1300
committeruser <user@laptop.(none)>2012-10-21 17:44:59 +1300
commita3441d3bcd02ec48e408957dfdc61dc6850bc339 (patch)
treeb62cd0cd31b7deb2e6c4360e5a4d2cbcba55acc4 /src/org/traccar/Server.java
parentf5bb85ff12db673ecc30f5cbaddc3b43a9d3310b (diff)
downloadtraccar-server-a3441d3bcd02ec48e408957dfdc61dc6850bc339.tar.gz
traccar-server-a3441d3bcd02ec48e408957dfdc61dc6850bc339.tar.bz2
traccar-server-a3441d3bcd02ec48e408957dfdc61dc6850bc339.zip
Add JT600 support (fix #58)
Diffstat (limited to 'src/org/traccar/Server.java')
-rw-r--r--src/org/traccar/Server.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/org/traccar/Server.java b/src/org/traccar/Server.java
index f09e15913..140862d8b 100644
--- a/src/org/traccar/Server.java
+++ b/src/org/traccar/Server.java
@@ -100,6 +100,7 @@ public class Server {
initST210Server(properties);
initProgressServer(properties);
initH02Server(properties);
+ initJt600Server(properties);
// Initialize web server
@@ -547,4 +548,25 @@ public class Server {
}
}
+ /**
+ * Init JT600 server
+ */
+ private void initJt600Server(Properties properties) throws SQLException {
+
+ String protocol = "jt600";
+ if (isProtocolEnabled(properties, protocol)) {
+
+ TrackerServer server = new TrackerServer(getProtocolPort(properties, protocol));
+ final Integer resetDelay = getProtocolResetDelay(properties, protocol);
+
+ server.setPipelineFactory(new GenericPipelineFactory(server, dataManager, isLoggerEnabled(), geocoder) {
+ protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ pipeline.addLast("frameDecoder", new Jt600FrameDecoder());
+ pipeline.addLast("objectDecoder", new Jt600ProtocolDecoder(getDataManager(), resetDelay));
+ }
+ });
+
+ serverList.add(server);
+ }
+ }
}