diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-01 09:56:32 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-01 09:56:32 +1300 |
commit | f16ce106253ce3a857efbe4cd7b65f76c77d6364 (patch) | |
tree | a8c59b88518afbec9cebc74f4c59b14039ad5e5b /src/org | |
parent | 161875aaccca9799fb0e79948781547930664158 (diff) | |
download | trackermap-server-f16ce106253ce3a857efbe4cd7b65f76c77d6364.tar.gz trackermap-server-f16ce106253ce3a857efbe4cd7b65f76c77d6364.tar.bz2 trackermap-server-f16ce106253ce3a857efbe4cd7b65f76c77d6364.zip |
Fix issues in FlexTrack decoder
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/FlextrackProtocolDecoder.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/FlextrackProtocolDecoder.java b/src/org/traccar/protocol/FlextrackProtocolDecoder.java index 0622cbc3a..12ed78bee 100644 --- a/src/org/traccar/protocol/FlextrackProtocolDecoder.java +++ b/src/org/traccar/protocol/FlextrackProtocolDecoder.java @@ -61,7 +61,7 @@ public class FlextrackProtocolDecoder extends BaseProtocolDecoder { "(\\d+)," + // HDOP "(\\p{XDigit}+)," + // Cell "\\d+," + // GPS fix time - "(\\d+)," + // LAC + "(\\p{XDigit}+)," + // LAC "(\\d+)"); // Odometer private void sendAcknowledgement(Channel channel, String index) { @@ -97,7 +97,9 @@ public class FlextrackProtocolDecoder extends BaseProtocolDecoder { } } - } else if (sentence.contains("UNITSTAT")) { + } else if (sentence.contains("UNITSTAT") && hasDeviceId()) { + + String x = PatternUtil.checkPattern(pattern.pattern(), sentence); Matcher parser = pattern.matcher(sentence); if (!parser.matches()) { @@ -106,6 +108,8 @@ public class FlextrackProtocolDecoder extends BaseProtocolDecoder { Position position = new Position(); position.setProtocol(getProtocolName()); + position.setDeviceId(getDeviceId()); + int index = 1; sendAcknowledgement(channel, parser.group(index++)); |