aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Mta6ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-06-29 10:48:34 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-06-29 10:48:34 +1200
commitd1c4cd526845aad56c5b0a3e20454638bbc7fecc (patch)
tree565ee245ea0e98b88674b775147fbc6d3e1933cb /src/org/traccar/protocol/Mta6ProtocolDecoder.java
parent88b3f00f3855aa408c7859051efdcb5b37fe559f (diff)
downloadtrackermap-server-d1c4cd526845aad56c5b0a3e20454638bbc7fecc.tar.gz
trackermap-server-d1c4cd526845aad56c5b0a3e20454638bbc7fecc.tar.bz2
trackermap-server-d1c4cd526845aad56c5b0a3e20454638bbc7fecc.zip
Merge commands implmentation (fix #1271)
Diffstat (limited to 'src/org/traccar/protocol/Mta6ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Mta6ProtocolDecoder.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/Mta6ProtocolDecoder.java b/src/org/traccar/protocol/Mta6ProtocolDecoder.java
index 459b8bcb8..8872ba76a 100644
--- a/src/org/traccar/protocol/Mta6ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Mta6ProtocolDecoder.java
@@ -32,6 +32,7 @@ import org.jboss.netty.handler.codec.http.HttpResponseStatus;
import org.jboss.netty.handler.codec.http.HttpVersion;
import org.traccar.BaseProtocolDecoder;
import org.traccar.helper.BitUtil;
+import org.traccar.Protocol;
import org.traccar.helper.ChannelBufferTools;
import org.traccar.model.Event;
import org.traccar.model.Position;
@@ -40,7 +41,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder {
private boolean simple;
- public Mta6ProtocolDecoder(String protocol, boolean simple) {
+ public Mta6ProtocolDecoder(Protocol protocol, boolean simple) {
super(protocol);
this.simple = simple;
}
@@ -123,7 +124,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder {
while (buf.readable()) {
Position position = new Position();
position.setDeviceId(getDeviceId());
- position.setProtocol(getProtocol());
+ position.setProtocol(getProtocolName());
short flags = buf.readUnsignedByte();
@@ -202,7 +203,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder {
private Position parseFormatA1(ChannelBuffer buf) {
Position position = new Position();
position.setDeviceId(getDeviceId());
- position.setProtocol(getProtocol());
+ position.setProtocol(getProtocolName());
short flags = buf.readUnsignedByte();
@@ -289,7 +290,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder {
buf.skipBytes("id=".length());
int index = ChannelBufferTools.find(buf, buf.readerIndex(), length, "&");
String uniqueId = buf.toString(buf.readerIndex(), index - buf.readerIndex(), Charset.defaultCharset());
- if (!identify(uniqueId)) {
+ if (!identify(uniqueId, channel)) {
return null;
}
buf.skipBytes(uniqueId.length());