aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-01 09:56:32 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-01 09:56:32 +1300
commitf16ce106253ce3a857efbe4cd7b65f76c77d6364 (patch)
treea8c59b88518afbec9cebc74f4c59b14039ad5e5b /src
parent161875aaccca9799fb0e79948781547930664158 (diff)
downloadtraccar-server-f16ce106253ce3a857efbe4cd7b65f76c77d6364.tar.gz
traccar-server-f16ce106253ce3a857efbe4cd7b65f76c77d6364.tar.bz2
traccar-server-f16ce106253ce3a857efbe4cd7b65f76c77d6364.zip
Fix issues in FlexTrack decoder
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/FlextrackProtocolDecoder.java8
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++));