aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/H02ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-12-02 03:43:46 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-12-02 03:43:46 +1300
commit6782f2ee534494aa24dc73299f71e4227077e037 (patch)
treee1b5582037ded1319cf3fae90bc1fcdd75bfcc30 /src/org/traccar/protocol/H02ProtocolDecoder.java
parentf63658504320cb96501cf83d698ba932840e315b (diff)
downloadtrackermap-server-6782f2ee534494aa24dc73299f71e4227077e037.tar.gz
trackermap-server-6782f2ee534494aa24dc73299f71e4227077e037.tar.bz2
trackermap-server-6782f2ee534494aa24dc73299f71e4227077e037.zip
Decode H02 cell info
Diffstat (limited to 'src/org/traccar/protocol/H02ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/H02ProtocolDecoder.java19
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;
}