diff options
Diffstat (limited to 'src/org/traccar/protocol/H02ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/H02ProtocolDecoder.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index 37f6294be..a717ddc4d 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -75,7 +75,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_ALARM, Position.ALARM_OVERSPEED); } - position.set(Position.KEY_IGNITION, !BitUtil.check(status, 10)); + position.set(Position.KEY_IGNITION, BitUtil.check(status, 10)); position.set(Position.KEY_STATUS, status); } @@ -165,16 +165,10 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { .expression("([EW]),") .number("(d+.?d*),") // speed .number("(d+.?d*)?,") // course - .number("(?:(dd)(dd)(dd))?,") // date (ddmmyy) - .any() - .number("(x{8})") // status - .groupBegin() - .number(", *(x+),") // mcc - .number(" *(x+),") // mnc - .number(" *(x+),") // lac - .number(" *(x+)") // cid - .groupEnd("?") + .number("(?:(dd)(dd)(dd))?") // date (ddmmyy) .any() + .number(",(x{8})") // status + .expression("(?:#|,.*)") .compile(); private static final Pattern PATTERN_NBR = new PatternBuilder() |