diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2012-12-11 21:16:29 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2012-12-11 21:16:29 +1300 |
commit | 77f410b00568e09d503fffdbf42d6eb08aeae570 (patch) | |
tree | 32285726faa88cb7c2ad8d5c3969821db6dbc4dc /src/org | |
parent | 7cc49096e7ea6965a3164ff3ffd66876bc94646c (diff) | |
download | traccar-server-77f410b00568e09d503fffdbf42d6eb08aeae570.tar.gz traccar-server-77f410b00568e09d503fffdbf42d6eb08aeae570.tar.bz2 traccar-server-77f410b00568e09d503fffdbf42d6eb08aeae570.zip |
More Skypatrol stuff
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/Server.java | 24 | ||||
-rw-r--r-- | src/org/traccar/protocol/SkypatrolProtocolDecoder.java | 4 |
2 files changed, 26 insertions, 2 deletions
diff --git a/src/org/traccar/Server.java b/src/org/traccar/Server.java index 9a4bcd1d4..9deb271da 100644 --- a/src/org/traccar/Server.java +++ b/src/org/traccar/Server.java @@ -110,6 +110,7 @@ public class Server { initTr20Server(properties); initNavisServer(properties); initMeitrackServer(properties); + initSkypatrolServer(properties); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -786,4 +787,27 @@ public class Server { serverList.add(server); } } + + /** + * Init SkyPatrol server + */ + private void initSkypatrolServer(Properties properties) throws SQLException { + + String protocol = "skypatrol"; + if (isProtocolEnabled(properties, protocol)) { + + TrackerServer server = new TrackerServer(new ServerBootstrap()); + server.setPort(getProtocolPort(properties, protocol)); + server.setAddress(getProtocolInterface(properties, protocol)); + final Integer resetDelay = getProtocolResetDelay(properties, protocol); + + server.setPipelineFactory(new GenericPipelineFactory(server, dataManager, isLoggerEnabled(), resetDelay, geocoder) { + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("objectDecoder", new SkypatrolProtocolDecoder(getDataManager())); + } + }); + + serverList.add(server); + } + } } diff --git a/src/org/traccar/protocol/SkypatrolProtocolDecoder.java b/src/org/traccar/protocol/SkypatrolProtocolDecoder.java index 184f5e40b..d5adf2aaf 100644 --- a/src/org/traccar/protocol/SkypatrolProtocolDecoder.java +++ b/src/org/traccar/protocol/SkypatrolProtocolDecoder.java @@ -29,7 +29,7 @@ import org.traccar.model.Position; /** * T55 tracker protocol decoder */ -public class T55ProtocolDecoder extends GenericProtocolDecoder { +public class SkypatrolProtocolDecoder extends GenericProtocolDecoder { /** * Device ID @@ -39,7 +39,7 @@ public class T55ProtocolDecoder extends GenericProtocolDecoder { /** * Initialize */ - public T55ProtocolDecoder(DataManager dataManager) { + public SkypatrolProtocolDecoder(DataManager dataManager) { super(dataManager); } |