aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-07-26 21:06:27 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2013-07-26 21:06:27 +1200
commit6cec98cfcbad9b62877c93fa085bfaab5378f8a8 (patch)
tree4d2936e2788b3cd57592ec568c777c57a5107972 /src/org/traccar/ServerManager.java
parentf4d73d79fbee9859ce8da66c7c0ad4af8bca9b9e (diff)
downloadtrackermap-server-6cec98cfcbad9b62877c93fa085bfaab5378f8a8.tar.gz
trackermap-server-6cec98cfcbad9b62877c93fa085bfaab5378f8a8.tar.bz2
trackermap-server-6cec98cfcbad9b62877c93fa085bfaab5378f8a8.zip
Start pt3000 implementation
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r--src/org/traccar/ServerManager.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 55e4e4eeb..465ef3d8e 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -151,6 +151,7 @@ public class ServerManager {
initManPowerServer("manpower");
initGlobalSatServer("globalsat");
initAtrackServer("atrack");
+ initPt3000Server("pt3000");
// Initialize web server
if (Boolean.valueOf(properties.getProperty("http.enable"))) {
@@ -904,4 +905,18 @@ public class ServerManager {
}
}
+ private void initPt3000Server(String protocol) throws SQLException {
+ if (isProtocolEnabled(properties, protocol)) {
+ serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) {
+ @Override
+ protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024));
+ pipeline.addLast("stringDecoder", new StringDecoder());
+ pipeline.addLast("stringEncoder", new StringEncoder());
+ pipeline.addLast("objectDecoder", new Pt3000ProtocolDecoder(ServerManager.this));
+ }
+ });
+ }
+ }
+
}