diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-05 15:21:25 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-05 15:21:25 +1300 |
commit | 18b2c5fe99ce5013c512473cdf3ca5b6aa4aba3d (patch) | |
tree | e39829667258d1026b4c9b318471f7d8c264284c /src/org/traccar/protocol | |
parent | d6e585d7a989799c31e09578ed20666c9a4054cf (diff) | |
download | trackermap-server-18b2c5fe99ce5013c512473cdf3ca5b6aa4aba3d.tar.gz trackermap-server-18b2c5fe99ce5013c512473cdf3ca5b6aa4aba3d.tar.bz2 trackermap-server-18b2c5fe99ce5013c512473cdf3ca5b6aa4aba3d.zip |
Improve Meitrack LBS data decoding
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r-- | src/org/traccar/protocol/MeitrackProtocolDecoder.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java index e6e3dd057..86fcac375 100644 --- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -57,10 +57,10 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { .number("(-?d+),") // altitude .number("(d+),") // odometer .number("(d+),") // runtime - .number("(d+|") - .number("d+|") - .number("x+|") - .number("x+),") // cell + .number("(d+)|") // mcc + .number("(d+)|") // mnc + .number("(x+)|") // lac + .number("(x+),") // cell .number("(x+),") // state .number("(x+)?|") // adc1 .number("(x+)?|") // adc2 @@ -119,6 +119,9 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { position.set(Event.KEY_ODOMETER, parser.next()); position.set("runtime", parser.next()); + position.set(Event.KEY_MCC, parser.next()); + position.set(Event.KEY_MCC, parser.next()); + position.set(Event.KEY_LAC, parser.next()); position.set(Event.KEY_CELL, parser.next()); position.set(Event.KEY_STATUS, parser.next()); @@ -192,9 +195,10 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { position.set(Event.KEY_ODOMETER, buf.readUnsignedInt()); position.set("runtime", buf.readUnsignedInt()); - position.set(Event.KEY_CELL, - buf.readUnsignedShort() + "|" + buf.readUnsignedShort() + "|" + - buf.readUnsignedShort() + "|" + buf.readUnsignedShort()); + position.set(Event.KEY_MCC, buf.readUnsignedShort()); + position.set(Event.KEY_MCC, buf.readUnsignedShort()); + position.set(Event.KEY_LAC, buf.readUnsignedShort()); + position.set(Event.KEY_CELL, buf.readUnsignedShort()); position.set(Event.KEY_STATUS, buf.readUnsignedShort()); position.set(Event.PREFIX_ADC + 1, buf.readUnsignedShort()); |