diff options
author | user <user@laptop.(none)> | 2012-10-21 17:44:59 +1300 |
---|---|---|
committer | user <user@laptop.(none)> | 2012-10-21 17:44:59 +1300 |
commit | a3441d3bcd02ec48e408957dfdc61dc6850bc339 (patch) | |
tree | b62cd0cd31b7deb2e6c4360e5a4d2cbcba55acc4 /src/org/traccar/Server.java | |
parent | f5bb85ff12db673ecc30f5cbaddc3b43a9d3310b (diff) | |
download | trackermap-server-a3441d3bcd02ec48e408957dfdc61dc6850bc339.tar.gz trackermap-server-a3441d3bcd02ec48e408957dfdc61dc6850bc339.tar.bz2 trackermap-server-a3441d3bcd02ec48e408957dfdc61dc6850bc339.zip |
Add JT600 support (fix #58)
Diffstat (limited to 'src/org/traccar/Server.java')
-rw-r--r-- | src/org/traccar/Server.java | 22 |
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); + } + } } |