aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-02-14 16:00:15 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:15:06 +0100
commit2a12322a80d7c6a41c447c4c6bbfc5810b498b0c (patch)
treef9393422aba446a6af579a09e299be92119acf11 /src
parent5589df8946793f14159bc1b341999fea1428e709 (diff)
modem-helpers: allow leading zeroes in CREG/CGREG responses
Diffstat (limited to 'src')
-rw-r--r--src/mm-modem-helpers.c2
-rw-r--r--src/tests/test-modem-helpers.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
index 7f47d453..2e4c33e2 100644
--- a/src/mm-modem-helpers.c
+++ b/src/mm-modem-helpers.c
@@ -542,7 +542,7 @@ mm_3gpp_parse_pdp_query_response (const gchar *reply,
#define CREG7 "\\+(CREG|CGREG):\\s*0*([0-9]),\\s*0*([0-9])\\s*,\\s*([^,\\s]*)\\s*,\\s*([^,\\s]*)\\s*,\\s*([^,\\s]*)\\s*,\\s*[^,\\s]*"
/* +CREG: <stat>,<lac>,<ci>,<AcT>,<RAC> (ETSI 27.007 v9.20 CREG=2 unsolicited with RAC) */
-#define CREG8 "\\+(CREG|CGREG):\\s*(\\d{1})\\s*,\\s*([^,\\s]*)\\s*,\\s*([^,\\s]*)\\s*,\\s*(\\d{1,2})\\s*,\\s*([^,\\s]*)"
+#define CREG8 "\\+(CREG|CGREG):\\s*0*([0-9])\\s*,\\s*([^,\\s]*)\\s*,\\s*([^,\\s]*)\\s*,\\s*0*([0-9])\\s*,\\s*([^,\\s]*)"
GPtrArray *
mm_3gpp_creg_regex_get (gboolean solicited)
diff --git a/src/tests/test-modem-helpers.c b/src/tests/test-modem-helpers.c
index 707e4185..07878412 100644
--- a/src/tests/test-modem-helpers.c
+++ b/src/tests/test-modem-helpers.c
@@ -624,7 +624,7 @@ test_creg2_iridium_solicited (void *f, gpointer d)
{
TestData *data = (TestData *) d;
const char *reply = "+CREG:002,001,\"18d8\",\"ffff\"";
- const CregResult result = { 1, 0x18D8, 0xFFFF, -1 , 4, FALSE};
+ const CregResult result = { 1, 0x18D8, 0xFFFF, MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN, 4, FALSE};
test_creg_match ("Iridium, CREG=2", TRUE, reply, data, &result);
}