aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorHans van den Elsen <hans.elsen@esds.nl>2016-02-15 07:28:03 +0100
committerHans van den Elsen <hans.elsen@esds.nl>2016-02-15 07:28:03 +0100
commit3ced99384b1967f5cde9abdf30c1c0184a5ae3f6 (patch)
tree14f0543b9a2607be8be7f140a78ac521f8646d7e /src/org/traccar
parent30d886b86bb76dc7e3a13cffb63252d31f0abe2a (diff)
downloadtrackermap-server-3ced99384b1967f5cde9abdf30c1c0184a5ae3f6.tar.gz
trackermap-server-3ced99384b1967f5cde9abdf30c1c0184a5ae3f6.tar.bz2
trackermap-server-3ced99384b1967f5cde9abdf30c1c0184a5ae3f6.zip
Polishing up the custom commands for MiniFinder
Renamed Command.CUSTOM to TYPE_CUSTOM. Put the raw command in the 'raw' attribute instead as the key for one.
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/model/Command.java2
-rw-r--r--src/org/traccar/protocol/MiniFinderProtocol.java3
-rw-r--r--src/org/traccar/protocol/MiniFinderProtocolEncoder.java4
3 files changed, 4 insertions, 5 deletions
diff --git a/src/org/traccar/model/Command.java b/src/org/traccar/model/Command.java
index 5bde1c652..dd541e643 100644
--- a/src/org/traccar/model/Command.java
+++ b/src/org/traccar/model/Command.java
@@ -38,5 +38,5 @@ public class Command extends Extensible {
public static final String KEY_DEVICE_PASSWORD = "devicePassword";
public static final String KEY_RADIUS = "radius";
- public static final String CUSTOM = "CUSTOM";
+ public static final String TYPE_CUSTOM = "CUSTOM";
}
diff --git a/src/org/traccar/protocol/MiniFinderProtocol.java b/src/org/traccar/protocol/MiniFinderProtocol.java
index a2dbd6c41..b22539277 100644
--- a/src/org/traccar/protocol/MiniFinderProtocol.java
+++ b/src/org/traccar/protocol/MiniFinderProtocol.java
@@ -18,7 +18,6 @@ package org.traccar.protocol;
import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.handler.codec.string.StringDecoder;
-import org.jboss.netty.handler.codec.string.StringEncoder;
import org.traccar.BaseProtocol;
import org.traccar.CharacterDelimiterFrameDecoder;
import org.traccar.TrackerServer;
@@ -30,7 +29,7 @@ public class MiniFinderProtocol extends BaseProtocol {
public MiniFinderProtocol() {
super("minifinder");
- setSupportedCommands(Command.CUSTOM);
+ setSupportedCommands(Command.TYPE_CUSTOM);
}
@Override
diff --git a/src/org/traccar/protocol/MiniFinderProtocolEncoder.java b/src/org/traccar/protocol/MiniFinderProtocolEncoder.java
index 5d15bc54a..729c57573 100644
--- a/src/org/traccar/protocol/MiniFinderProtocolEncoder.java
+++ b/src/org/traccar/protocol/MiniFinderProtocolEncoder.java
@@ -27,8 +27,8 @@ public class MiniFinderProtocolEncoder extends StringProtocolEncoder {
protected Object encodeCommand(Command command) {
switch (command.getType()) {
- case Command.CUSTOM:
- return command.getAttributes().keySet().iterator().next().toString();
+ case Command.TYPE_CUSTOM:
+ return command.getAttributes().get("raw");
default:
Log.warning(new UnsupportedOperationException(command.getType()));
break;