aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-12-20 11:00:56 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2014-12-20 11:00:56 +1300
commit5c7b1668d524aee47885caa90740b72395b6f6d6 (patch)
treeeb9cfef0a22d5ec951cc55d452875e4f8cd94837
parent377822c54373e2ccef485d54482114a661cb926c (diff)
downloadtraccar-server-5c7b1668d524aee47885caa90740b72395b6f6d6.tar.gz
traccar-server-5c7b1668d524aee47885caa90740b72395b6f6d6.tar.bz2
traccar-server-5c7b1668d524aee47885caa90740b72395b6f6d6.zip
Fix T55 identification (fix #1008)
-rw-r--r--src/org/traccar/protocol/T55ProtocolDecoder.java6
-rw-r--r--test/org/traccar/protocol/T55ProtocolDecoderTest.java3
2 files changed, 8 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/T55ProtocolDecoder.java b/src/org/traccar/protocol/T55ProtocolDecoder.java
index 0f2da7d65..25b7f367f 100644
--- a/src/org/traccar/protocol/T55ProtocolDecoder.java
+++ b/src/org/traccar/protocol/T55ProtocolDecoder.java
@@ -101,7 +101,11 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder {
if (!sentence.startsWith("$") && sentence.contains("$")) {
int index = sentence.indexOf("$");
- identify(sentence.substring(0, index));
+ String id = sentence.substring(0, index);
+ if (id.endsWith(",")) {
+ id = id.substring(0, id.length() - 1);
+ }
+ identify(id);
sentence = sentence.substring(index);
}
diff --git a/test/org/traccar/protocol/T55ProtocolDecoderTest.java b/test/org/traccar/protocol/T55ProtocolDecoderTest.java
index 4f4818d82..48f462775 100644
--- a/test/org/traccar/protocol/T55ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/T55ProtocolDecoderTest.java
@@ -55,6 +55,9 @@ public class T55ProtocolDecoderTest {
verify(decoder.decode(null, null,
"123456789$GPRMC,155708.252,V,4610.1676,N,00606.4586,E,000.0,000.0,060214,,,N*76"));
+
+ verify(decoder.decode(null, null,
+ "990000561287964,$GPRMC,213516.0,A,4337.216791,N,11611.995877,W,0.0,335.4,181214,,,A * 72"));
}