diff options
-rw-r--r-- | src/org/traccar/protocol/L100ProtocolDecoder.java | 3 | ||||
-rw-r--r-- | test/org/traccar/protocol/L100ProtocolDecoderTest.java | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/L100ProtocolDecoder.java b/src/org/traccar/protocol/L100ProtocolDecoder.java index c4a4c0d58..4d6b8f34b 100644 --- a/src/org/traccar/protocol/L100ProtocolDecoder.java +++ b/src/org/traccar/protocol/L100ProtocolDecoder.java @@ -40,6 +40,7 @@ public class L100ProtocolDecoder extends BaseProtocolDecoder { private static final Pattern PATTERN = new PatternBuilder() .text("ATL") + .expression(",[^,]+,").optional() .number("(d{15}),") // imei .text("$GPRMC,") .number("(dd)(dd)(dd)") // time (hhmmss.sss) @@ -142,7 +143,7 @@ public class L100ProtocolDecoder extends BaseProtocolDecoder { } else { return decodeObdLocation(channel, remoteAddress, sentence); } - } else if (sentence.startsWith("ATL,") || sentence.substring(0, 1).matches("[NPT]")) { + } else if (!sentence.contains("$GPRMC")) { return decodeNew(channel, remoteAddress, sentence); } else { return decodeNormal(channel, remoteAddress, sentence); diff --git a/test/org/traccar/protocol/L100ProtocolDecoderTest.java b/test/org/traccar/protocol/L100ProtocolDecoderTest.java index e61e133a4..04f586f7a 100644 --- a/test/org/traccar/protocol/L100ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/L100ProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class L100ProtocolDecoderTest extends ProtocolTest { L100ProtocolDecoder decoder = new L100ProtocolDecoder(null); verifyPosition(decoder, text( + "ATL,NP,868004029750174,$GPRMC,062943,A,2533.6719,N,09154.3203,E,0,179,311218,,,*39,#01111011000000,0,0,0,934.82,27.13,4.0,25,405,755,15af,974b,0,0,0,ATL")); + + verifyPosition(decoder, text( "ATL,L,868345038171963,N,201218,093016,A,025.067144,N,055.144833,E,000.0,GPS,3939,424,03,00405,008834")); verifyPosition(decoder, text( |