diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-03-21 11:24:18 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-03-21 13:39:33 +0100 |
commit | 5285e958abcd734de73a13011b5243bcfdf4d20c (patch) | |
tree | d10cfc8aee7cc5ef7cd12b9e854a07fc59519910 | |
parent | 192e067f97153125fe9d3362c750146a5a7215cf (diff) |
cinterion: allow '*' in Prov/Cfg response
E.g. in a Cinterion PLS8-E (REVISION 04.004) to match the following
line:
^SCFG: "MEopMode/Prov/Cfg","fallback*"
Fix suggested by Jan Mazura.
See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/347
-rw-r--r-- | plugins/cinterion/mm-modem-helpers-cinterion.c | 2 | ||||
-rw-r--r-- | plugins/cinterion/tests/test-modem-helpers-cinterion.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/plugins/cinterion/mm-modem-helpers-cinterion.c b/plugins/cinterion/mm-modem-helpers-cinterion.c index cf18ea69..9e34a69f 100644 --- a/plugins/cinterion/mm-modem-helpers-cinterion.c +++ b/plugins/cinterion/mm-modem-helpers-cinterion.c @@ -1515,7 +1515,7 @@ mm_cinterion_provcfg_response_to_cid (const gchar *response, g_autoptr(GMatchInfo) match_info = NULL; g_autofree gchar *mno = NULL; - r = g_regex_new ("\\^SCFG:\\s*\"MEopMode/Prov/Cfg\",\\s*\"([0-9a-zA-Z]*)\"", 0, 0, NULL); + r = g_regex_new ("\\^SCFG:\\s*\"MEopMode/Prov/Cfg\",\\s*\"([0-9a-zA-Z*]*)\"", 0, 0, NULL); g_assert (r != NULL); if (!g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, error)) diff --git a/plugins/cinterion/tests/test-modem-helpers-cinterion.c b/plugins/cinterion/tests/test-modem-helpers-cinterion.c index 1227a70f..25e08473 100644 --- a/plugins/cinterion/tests/test-modem-helpers-cinterion.c +++ b/plugins/cinterion/tests/test-modem-helpers-cinterion.c @@ -1636,6 +1636,11 @@ static const ProvcfgResponseTest provcfg_response_tests[] = { .str = "* ^SCFG: \"MEopMode/Prov/Cfg\",\"tmode\"", .modem_family = MM_CINTERION_MODEM_FAMILY_DEFAULT, .expected_cid = 2, + }, + { + .str = "* ^SCFG: \"MEopMode/Prov/Cfg\",\"fallback*\"", + .modem_family = MM_CINTERION_MODEM_FAMILY_DEFAULT, + .expected_cid = 1, } }; |