aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-01-11 12:29:29 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2014-01-11 12:29:29 +1300
commit84e654028ac2d9cbba79d8898b16ca0cc0212f4a (patch)
treee69367387508a64f7dc2e9a043a3d0f8ca71eaa0 /src
parente357f5f9cd877c7ee79f950582e2d360080ef7ab (diff)
downloadtraccar-server-84e654028ac2d9cbba79d8898b16ca0cc0212f4a.tar.gz
traccar-server-84e654028ac2d9cbba79d8898b16ca0cc0212f4a.tar.bz2
traccar-server-84e654028ac2d9cbba79d8898b16ca0cc0212f4a.zip
Add UDP TAIP protocol
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/ServerManager.java14
-rw-r--r--src/org/traccar/protocol/SyrusProtocolDecoder.java7
2 files changed, 15 insertions, 6 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 56a5a1c08..74debb35b 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 - 2013 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2012 - 2014 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -158,6 +158,7 @@ public class ServerManager {
initM2mServer("m2m");
initOsmAndServer("osmand");
initEasyTrackServer("easytrack");
+ initTaipServer("taip");
// Initialize web server
if (Boolean.valueOf(properties.getProperty("http.enable"))) {
@@ -1018,4 +1019,15 @@ public class ServerManager {
}
}
+ private void initTaipServer(String protocol) throws SQLException {
+ if (isProtocolEnabled(properties, protocol)) {
+ serverList.add(new TrackerServer(this, new ConnectionlessBootstrap(), protocol) {
+ @Override
+ protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ pipeline.addLast("objectDecoder", new SyrusProtocolDecoder(ServerManager.this));
+ }
+ });
+ }
+ }
+
}
diff --git a/src/org/traccar/protocol/SyrusProtocolDecoder.java b/src/org/traccar/protocol/SyrusProtocolDecoder.java
index 66d6872e4..b20e16bcb 100644
--- a/src/org/traccar/protocol/SyrusProtocolDecoder.java
+++ b/src/org/traccar/protocol/SyrusProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2013 - 2014 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,10 +34,7 @@ public class SyrusProtocolDecoder extends BaseProtocolDecoder {
super(serverManager);
}
- /**
- * Regular expressions pattern
- */
- static private Pattern pattern = Pattern.compile(
+ private static final Pattern pattern = Pattern.compile(
"R[EP]V" + // Type
"(?:\\d{2}" + // Event index
"(\\d{4})" + // Week