diff options
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/MeiligaoProtocolDecoder.java | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java index cb2139a00..5c17aab61 100644 --- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java +++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java @@ -54,23 +54,19 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { .number("|(xxxx)?") // state .groupBegin() .number("|(xxxx),(xxxx)") // adc + .number("(?:,(xxxx),(xxxx),(xxxx),(xxxx),(xxxx),(xxxx))?") .groupBegin() - .number(",(xxxx),(xxxx),(xxxx),(xxxx),(xxxx),(xxxx)") - .groupEnd("?") - .groupBegin() - .text("|") - .groupBegin() - .number("(x{16})") // cell + .number("|x{16}") // cell .number("|(xx)") // gsm - .number("|(x{8})|") // odometer - .number("(x{9})") // odometer + .number("|(x{8})") // odometer + .or() + .number("|(x{9})") // odometer .groupBegin() .number("|(x{5,})") // rfid .groupEnd("?") .groupEnd("?") .groupEnd("?") .groupEnd("?") - .groupEnd("?") .any() .compile(); @@ -283,15 +279,14 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { } } - position.set(Event.KEY_CID, parser.next()); - if (parser.hasNext()) { position.set(Event.KEY_GSM, parser.nextInt(16)); } if (parser.hasNext()) { position.set(Event.KEY_ODOMETER, parser.nextInt(16)); - } else if (parser.hasNext()) { + } + if (parser.hasNext()) { position.set(Event.KEY_ODOMETER, parser.nextInt(16)); } |