diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-07-29 11:10:57 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-07-29 12:26:06 -0500 |
commit | 863f4e367f6a9c6aa1064c01e1751d2bdc2b10fc (patch) | |
tree | 7ccd6ffc34890207c142a01dc50f0b772514e582 /drivers/atmodem | |
parent | 2dbf3cbceb063e1161cede33c7ca3b3d8a133d26 (diff) | |
download | ofono-863f4e367f6a9c6aa1064c01e1751d2bdc2b10fc.tar.bz2 |
Tweak CREG notification to be more fault tolerant
Diffstat (limited to 'drivers/atmodem')
-rw-r--r-- | drivers/atmodem/network-registration.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/atmodem/network-registration.c b/drivers/atmodem/network-registration.c index f30c41af..44f08468 100644 --- a/drivers/atmodem/network-registration.c +++ b/drivers/atmodem/network-registration.c @@ -95,13 +95,18 @@ static void at_creg_cb(gboolean ok, GAtResult *result, gpointer user_data) if (g_at_result_iter_next_string(&iter, &str) == TRUE) lac = strtol(str, NULL, 16); + else + goto out; if (g_at_result_iter_next_string(&iter, &str) == TRUE) ci = strtol(str, NULL, 16); + else + goto out; if (g_at_result_iter_next_number(&iter, &tech) == TRUE) at->netreg->supports_tech = TRUE; +out: ofono_debug("creg_cb: %d, %d, %d, %d", status, lac, ci, tech); cb(&error, status, lac, ci, tech, cbd->data); @@ -601,13 +606,18 @@ static void creg_notify(GAtResult *result, gpointer user_data) if (g_at_result_iter_next_string(&iter, &str) == TRUE) lac = strtol(str, NULL, 16); + else + goto out; if (g_at_result_iter_next_string(&iter, &str) == TRUE) ci = strtol(str, NULL, 16); + else + goto out; if (g_at_result_iter_next_number(&iter, &tech) == TRUE) at->netreg->supports_tech = TRUE; +out: ofono_debug("creg_notify: %d, %d, %d, %d", status, lac, ci, tech); ofono_network_registration_notify(modem, status, lac, ci, tech); |