aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-07-16 10:14:55 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-07-16 10:14:55 +1200
commitc368b73417f8be914646bab0c49ac3672a848213 (patch)
tree0b11de01f721467f6d08fea2f226105d5310d6e3
parent946978e44223beb5b4b202c80dce6319f9a5cc14 (diff)
downloadtrackermap-server-c368b73417f8be914646bab0c49ac3672a848213.tar.gz
trackermap-server-c368b73417f8be914646bab0c49ac3672a848213.tar.bz2
trackermap-server-c368b73417f8be914646bab0c49ac3672a848213.zip
New Aplicom protocol version
-rw-r--r--src/org/traccar/protocol/AplicomProtocolDecoder.java5
-rw-r--r--test/org/traccar/protocol/AplicomProtocolDecoderTest.java7
2 files changed, 11 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/AplicomProtocolDecoder.java b/src/org/traccar/protocol/AplicomProtocolDecoder.java
index ff8858744..c7f04edf6 100644
--- a/src/org/traccar/protocol/AplicomProtocolDecoder.java
+++ b/src/org/traccar/protocol/AplicomProtocolDecoder.java
@@ -211,6 +211,11 @@ public class AplicomProtocolDecoder extends BaseProtocolDecoder {
buf.skipBytes(8);
}
+ // Cell info
+ if ((selector & 0x80000) != 0) {
+ buf.skipBytes(11);
+ }
+
// Event specific data
if ((selector & 0x1000) != 0) {
switch (event) {
diff --git a/test/org/traccar/protocol/AplicomProtocolDecoderTest.java b/test/org/traccar/protocol/AplicomProtocolDecoderTest.java
index 984322cc8..e01527bb2 100644
--- a/test/org/traccar/protocol/AplicomProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/AplicomProtocolDecoderTest.java
@@ -3,6 +3,8 @@ package org.traccar.protocol;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
import org.traccar.helper.ChannelBufferTools;
+
+import static org.junit.Assert.assertNull;
import static org.traccar.helper.DecoderVerifier.verify;
public class AplicomProtocolDecoderTest extends ProtocolDecoderTest {
@@ -11,7 +13,10 @@ public class AplicomProtocolDecoderTest extends ProtocolDecoderTest {
public void testDecode() throws Exception {
AplicomProtocolDecoder decoder = new AplicomProtocolDecoder(new AplicomProtocol());
-
+
+ assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
+ "44c3014645e8e9bada003e03fff7070055a4f24200000081000000000000000000000000000000000000000000000000000000000000000000000000000000ff00000001000000000000000044c3014645e8e9bada003e03fff77bff55a4f24300000081000000000000000000000000000000000000000000000000000000000000000000000000000000ff00300002000000000000000044c3014645e8e9bada003e03fff7690655a4f24500000081000000000000000000000000000000000000000000000000000000000000000000000000000000ff003000030000000000000000"))));
+
verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
"44c3014645e8e9d29a002d0022ff6d00f455893b4d55893b4c027a7e1500189d710800009e0000000000000000000000023300000000000000009d"))));