diff options
-rw-r--r-- | src/org/traccar/protocol/T55ProtocolDecoder.java | 2 | ||||
-rw-r--r-- | test/org/traccar/protocol/T55ProtocolDecoderTest.java | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/T55ProtocolDecoder.java b/src/org/traccar/protocol/T55ProtocolDecoder.java index 0a86e46a7..87c7a60c3 100644 --- a/src/org/traccar/protocol/T55ProtocolDecoder.java +++ b/src/org/traccar/protocol/T55ProtocolDecoder.java @@ -240,7 +240,7 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { this.position = null; return position; } - } else if (sentence.length() == 15 && Character.isDigit(sentence.charAt(0))) { + } else if (sentence.matches("^[0-9A-F]+$")) { identify(sentence, channel, remoteAddress); } else if (sentence.startsWith("$GPRMC")) { return decodeGprmc(sentence, remoteAddress, channel); diff --git a/test/org/traccar/protocol/T55ProtocolDecoderTest.java b/test/org/traccar/protocol/T55ProtocolDecoderTest.java index e8e5ba90e..753b4f689 100644 --- a/test/org/traccar/protocol/T55ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/T55ProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class T55ProtocolDecoderTest extends ProtocolTest { T55ProtocolDecoder decoder = new T55ProtocolDecoder(new T55Protocol()); verifyNothing(decoder, text( + "086415031C20")); + + verifyNothing(decoder, text( "358244017671308")); verifyNotNull(decoder, text( |