summaryrefslogtreecommitdiff
path: root/src/mm-modem-helpers.c
diff options
context:
space:
mode:
authorThomas Sailer <t.sailer@alumni.ethz.ch>2016-02-13 14:19:12 +0100
committerAleksander Morgado <aleksander@aleksander.es>2016-02-13 14:24:54 +0100
commita33615d6cb087c646de3b1899fbed0f7284f9340 (patch)
tree5adeffa29f27c06bab3742b4af29c543d634a870 /src/mm-modem-helpers.c
parent9cb0b22f915777a92ac4aa6442edfcf51a1f5601 (diff)
downloadModemManager-a33615d6cb087c646de3b1899fbed0f7284f9340.tar.gz
helpers: allow optional quotes in +CREG: <stat>,"<lac>","<ci>"
GSM 07.07 CREG=2 unsolicited pattern. Added testcase for Thuraya XT. Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
Diffstat (limited to 'src/mm-modem-helpers.c')
-rw-r--r--src/mm-modem-helpers.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
index 0331aa7bb..dec53c34b 100644
--- a/src/mm-modem-helpers.c
+++ b/src/mm-modem-helpers.c
@@ -434,6 +434,7 @@ mm_voice_clip_regex_get (void)
/* +CREG: <stat>,<lac>,<ci> (GSM 07.07 CREG=2 unsolicited) */
#define CREG3 "\\+(CREG|CGREG|CEREG):\\s*0*([0-9]),\\s*([^,\\s]*)\\s*,\\s*([^,\\s]*)"
+#define CREG11 "\\+(CREG|CGREG|CEREG):\\s*0*([0-9]),\\s*(\"[^\"\\s]*\")\\s*,\\s*(\"[^\"\\s]*\")"
/* +CREG: <n>,<stat>,<lac>,<ci> (GSM 07.07 solicited and some CREG=2 unsolicited) */
#define CREG4 "\\+(CREG|CGREG|CEREG):\\s*([0-9]),\\s*([0-9])\\s*,\\s*([^,]*)\\s*,\\s*([^,\\s]*)"
@@ -462,7 +463,7 @@ mm_voice_clip_regex_get (void)
GPtrArray *
mm_3gpp_creg_regex_get (gboolean solicited)
{
- GPtrArray *array = g_ptr_array_sized_new (12);
+ GPtrArray *array = g_ptr_array_sized_new (13);
GRegex *regex;
/* #1 */
@@ -545,6 +546,14 @@ mm_3gpp_creg_regex_get (gboolean solicited)
g_assert (regex);
g_ptr_array_add (array, regex);
+ /* #11 */
+ if (solicited)
+ regex = g_regex_new (CREG11 "$", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
+ else
+ regex = g_regex_new ("\\r\\n" CREG11 "\\r\\n", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
+ g_assert (regex);
+ g_ptr_array_add (array, regex);
+
/* CEREG #1 */
if (solicited)
regex = g_regex_new (CEREG1 "$", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);