aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/Server.java24
-rw-r--r--src/org/traccar/protocol/SkypatrolProtocolDecoder.java4
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);
}