From 18b2c5fe99ce5013c512473cdf3ca5b6aa4aba3d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 5 Nov 2015 15:21:25 +1300 Subject: Improve Meitrack LBS data decoding --- src/org/traccar/protocol/MeitrackProtocolDecoder.java | 18 +++++++++++------- 1 file 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()); -- cgit v1.2.3