diff options
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/H02ProtocolDecoder.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index 2b7d00969..2c7852d16 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -167,6 +167,12 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { .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("?") .any() .compile(); @@ -237,6 +243,19 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { processStatus(position, parser.nextLong(16)); + if (parser.hasNext(4)) { + int mcc = parser.nextInt(16); + int mnc = parser.nextInt(16); + int lac = parser.nextInt(16); + int cid = parser.nextInt(16); + if (mcc != 0 && mnc != 0 && lac != 0 && cid != 0) { + position.set(Position.KEY_MCC, mcc); + position.set(Position.KEY_MNC, mnc); + position.set(Position.KEY_LAC, lac); + position.set(Position.KEY_CID, cid); + } + } + return position; } |