Cinterion plugin (in)compatibilities

Aleksander Morgado aleksander at aleksander.es
Tue Feb 14 09:30:48 UTC 2017


On Tue, Feb 14, 2017 at 10:10 AM, Colin Helliwell
<colin.helliwell at ln-systems.com> wrote:
>>
> ...
>> I'm not confident of correctly interpreting the regex in smong_query_ready() (let alone fixing it properly!), but I wonder if the SMONG problem is that it's getting an additional CRLF. The response to the command is
>>
>> GPRS MonitorBCCH G PBCCH PAT MCC MNC NOM TA RAC # Cell #
>>
>
> Sorry, that should be
> '<CR><LF>GPRS Monitor<CR><LF><CR><LF>BCCH  G  PBCCH  PAT MCC  MNC  NOM  TA      RAC                              # Cell #<CR><LF>  44  1  -      -   234   10  -    -       -                                             <CR><LF><CR><LF><CR><LF><CR><LF>OK<CR><LF>'

Could you apply this change and retry?

diff --git a/plugins/cinterion/mm-broadband-modem-cinterion.c
b/plugins/cinterion/mm-broadband-modem-cinterion.c
index e82f78ae..33758840 100644
--- a/plugins/cinterion/mm-broadband-modem-cinterion.c
+++ b/plugins/cinterion/mm-broadband-modem-cinterion.c
@@ -677,7 +677,7 @@ smong_query_ready (MMBroadbandModemCinterion *self,
      */
     regex = g_regex_new (".*GPRS Monitor\\r\\n"
                          "BCCH\\s*G.*\\r\\n"
-                         "(\\d*)\\s*(\\d*)\\s*", 0, 0, NULL);
+                         "\\s*(\\d*)\\s*(\\d*)\\s*", 0, 0, NULL);
     if (g_regex_match_full (regex, response, strlen (response), 0, 0,
&match_info, NULL)) {
         gchar *gprs_status;
         MMModemAccessTechnology act;

Best thing would be to split this parsing out into its own helper
method, and add unit tests for it.

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list