aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r--src/org/traccar/ServerManager.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 836b1e3ff..94e68b7da 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -141,6 +141,7 @@ public class ServerManager {
initCellocatorServer("cellocator");
initGalileoServer("galileo");
initYwtServer("ywt");
+ initTk102Server("tk102");
// Initialize web server
if (Boolean.valueOf(properties.getProperty("http.enable"))) {
@@ -763,5 +764,21 @@ public class ServerManager {
});
}
}
-
+
+ private void initTk102Server(String protocol) throws SQLException {
+ if (isProtocolEnabled(properties, protocol)) {
+ serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) {
+ @Override
+ protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ byte delimiter[] = { (byte) ']' };
+ pipeline.addLast("frameDecoder",
+ new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter)));
+ pipeline.addLast("stringDecoder", new StringDecoder());
+ pipeline.addLast("stringEncoder", new StringEncoder());
+ pipeline.addLast("objectDecoder", new Tk102ProtocolDecoder(ServerManager.this));
+ }
+ });
+ }
+ }
+
}