diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2012-05-24 03:28:50 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-05-24 03:28:50 +0200 |
commit | 1f9f161e0b66fee9c0dd84ff77c51ea6645367cd (patch) | |
tree | 71d7c07f003f822282a352bd967dacd2acb3343b /drivers/atmodem/gprs.c | |
parent | ce395cd818b435c5ece1b3dfc8734ee7234ad7c7 (diff) | |
download | ofono-1f9f161e0b66fee9c0dd84ff77c51ea6645367cd.tar.bz2 |
atmodem: Fix issue with AT+CREG=? and AT+CGREG=? handling
Some modems might see an interim +CREG: or +CGREG: notification when
querying the supported modes.
Aux: > AT+CFUN=1\r
Aux: < \r\nOK\r\n
Aux: > AT+CREG=?\r
Aux: < \r\n+CREG: 2\r\n
Aux: < \r\n+CREG: (0-2)\r\nOK\r\n
Unable to initialize Network Registration
To make this work, skip to the first line with an actual range value.
Diffstat (limited to 'drivers/atmodem/gprs.c')
-rw-r--r-- | drivers/atmodem/gprs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/atmodem/gprs.c b/drivers/atmodem/gprs.c index 5f1d6100..65a8b7b9 100644 --- a/drivers/atmodem/gprs.c +++ b/drivers/atmodem/gprs.c @@ -318,11 +318,12 @@ static void at_cgreg_test_cb(gboolean ok, GAtResult *result, g_at_result_iter_init(&iter, result); +retry: if (!g_at_result_iter_next(&iter, "+CGREG:")) goto error; if (!g_at_result_iter_open_list(&iter)) - goto error; + goto retry; while (g_at_result_iter_next_range(&iter, &range[0], &range[1])) { if (1 >= range[0] && 1 <= range[1]) |