aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/MegastekProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/MegastekProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/MegastekProtocolDecoder.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/MegastekProtocolDecoder.java b/src/org/traccar/protocol/MegastekProtocolDecoder.java
index e28bf6c1d..c212e90fa 100644
--- a/src/org/traccar/protocol/MegastekProtocolDecoder.java
+++ b/src/org/traccar/protocol/MegastekProtocolDecoder.java
@@ -222,6 +222,7 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder {
}
private static final Pattern PATTERN_NEW = new PatternBuilder()
+ .number("dddd").optional()
.text("$MGV")
.number("ddd,")
.number("(d+),") // imei
@@ -342,7 +343,7 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder {
String sentence = (String) msg;
- if (sentence.startsWith("$MG")) {
+ if (sentence.contains("$MG")) {
return decodeNew(channel, remoteAddress, sentence);
} else {
return decodeOld(channel, remoteAddress, sentence);