aboutsummaryrefslogtreecommitdiff
path: root/plugins/cinterion/mm-modem-helpers-cinterion.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2017-03-07 17:39:42 +0100
committerAleksander Morgado <aleksander@aleksander.es>2017-03-07 18:40:51 +0100
commitc1d04f4cc03710cd213aa8ebc85f05ecc6ba62ea (patch)
tree00a84bd1c67021911dc048beda7157b2f64d1eff /plugins/cinterion/mm-modem-helpers-cinterion.c
parent73bfe94643eab39ef43a5023c482340ac9b882dc (diff)
cinterion: improve ^SCFG=? response parser to handle EHS5 format
Two main changes in the regex: * Ignore double quotes around interval numbers. * Ignore second set of values (i.e. the one after the comma), as it may not even be given). We now support at least these two formats: ^SCFG: "Radio/Band",("1-511","0-1") ^SCFG: "Radio/Band\",("1"-"147") Reported-by: Colin Helliwell <colin.helliwell@ln-systems.com>
Diffstat (limited to 'plugins/cinterion/mm-modem-helpers-cinterion.c')
-rw-r--r--plugins/cinterion/mm-modem-helpers-cinterion.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/cinterion/mm-modem-helpers-cinterion.c b/plugins/cinterion/mm-modem-helpers-cinterion.c
index 9bc8db4f..da1e7787 100644
--- a/plugins/cinterion/mm-modem-helpers-cinterion.c
+++ b/plugins/cinterion/mm-modem-helpers-cinterion.c
@@ -76,6 +76,7 @@ static const CinterionBand cinterion_bands[] = {
* ^SCFG: "Radio/NWSM",("0","1","2")
* ...
*
+ * ^SCFG: "Radio/Band\",("1"-"147")
*/
gboolean
@@ -94,7 +95,7 @@ mm_cinterion_parse_scfg_test (const gchar *response,
return FALSE;
}
- r = g_regex_new ("\\^SCFG:\\s*\"Radio/Band\",\\(\"([0-9a-fA-F]*)-([0-9a-fA-F]*)\",.*\\)",
+ r = g_regex_new ("\\^SCFG:\\s*\"Radio/Band\",\\((?:\")?([0-9]*)(?:\")?-(?:\")?([0-9]*)(?:\")?.*\\)",
G_REGEX_DOLLAR_ENDONLY | G_REGEX_RAW,
0, NULL);
g_assert (r != NULL);