diff options
Diffstat (limited to 'src/org/traccar')
-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++)); |