aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BaseProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-08-20 17:32:19 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-08-20 17:32:19 +1200
commit5848419666fc6eb14c5b0178a9738f19f0be2b61 (patch)
tree891288be7b13d70cff4cb6f36db3f7aeaa9f5a7c /src/org/traccar/BaseProtocolDecoder.java
parent98fd364db65daf847b2b76819cd36602aaef8d25 (diff)
downloadtrackermap-server-5848419666fc6eb14c5b0178a9738f19f0be2b61.tar.gz
trackermap-server-5848419666fc6eb14c5b0178a9738f19f0be2b61.tar.bz2
trackermap-server-5848419666fc6eb14c5b0178a9738f19f0be2b61.zip
Implement wristband tracker protocol
Diffstat (limited to 'src/org/traccar/BaseProtocolDecoder.java')
-rw-r--r--src/org/traccar/BaseProtocolDecoder.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java
index d7ccb6460..d9ab60e3a 100644
--- a/src/org/traccar/BaseProtocolDecoder.java
+++ b/src/org/traccar/BaseProtocolDecoder.java
@@ -67,6 +67,15 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder {
return protocol.getName();
}
+ public String getServer(Channel channel) {
+ String server = Context.getConfig().getString(getProtocolName() + ".server");
+ if (server == null && channel != null) {
+ InetSocketAddress address = (InetSocketAddress) channel.localAddress();
+ server = address.getAddress().getHostAddress() + ":" + address.getPort();
+ }
+ return server;
+ }
+
protected double convertSpeed(double value, String defaultUnits) {
switch (Context.getConfig().getString(getProtocolName() + ".speed", defaultUnits)) {
case "kmh":