diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-12-21 15:29:27 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-12-21 15:29:27 +1300 |
commit | aff70bdec220c4fb0c2b6dd05a2e858db383cefc (patch) | |
tree | ef4d4d47cee8218abbfaf163a5452acb6521c9c4 /src/org/traccar/protocol/MegastekProtocolDecoder.java | |
parent | 00ff8ce695d3a9baeaf999fd481bc2e897c84d7f (diff) | |
download | trackermap-server-aff70bdec220c4fb0c2b6dd05a2e858db383cefc.tar.gz trackermap-server-aff70bdec220c4fb0c2b6dd05a2e858db383cefc.tar.bz2 trackermap-server-aff70bdec220c4fb0c2b6dd05a2e858db383cefc.zip |
Implement new Megastek message format
Diffstat (limited to 'src/org/traccar/protocol/MegastekProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/MegastekProtocolDecoder.java | 3 |
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); |