summaryrefslogtreecommitdiffstats
path: root/plugins/mbm.c
diff options
context:
space:
mode:
authorPekka Pessi <Pekka.Pessi@nokia.com>2010-08-23 17:18:09 +0300
committerMarcel Holtmann <marcel@holtmann.org>2010-08-23 16:31:36 +0200
commit51a1bae8c784f5f2b3856bc73d1eb89b49221ba5 (patch)
tree5b56950e4192621e2154f407844b544f32d5a56f /plugins/mbm.c
parentff456286cf93af931d8880ea069900bcde1a991d (diff)
downloadofono-51a1bae8c784f5f2b3856bc73d1eb89b49221ba5.tar.bz2
mbm: fix initial polling for sim
There seems to be no specific error codes returned when SIM is missing. Poll at least 5 times upon an error and give up after that.
Diffstat (limited to 'plugins/mbm.c')
-rw-r--r--plugins/mbm.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/plugins/mbm.c b/plugins/mbm.c
index eb7b1a49..8541aafb 100644
--- a/plugins/mbm.c
+++ b/plugins/mbm.c
@@ -108,10 +108,8 @@ static void simpin_check(gboolean ok, GAtResult *result, gpointer user_data)
DBG("");
- /* Modem returns +CME ERROR: 10 if SIM is not ready. */
- if (!ok && result->final_or_pdu &&
- !strcmp(result->final_or_pdu, "+CME ERROR: 10") &&
- data->cpin_poll_count++ < 5) {
+ /* Modem returns an error if SIM is not ready. */
+ if (!ok && data->cpin_poll_count++ < 5) {
data->cpin_poll_source =
g_timeout_add_seconds(1, init_simpin_check, modem);
return;
@@ -119,7 +117,7 @@ static void simpin_check(gboolean ok, GAtResult *result, gpointer user_data)
data->cpin_poll_count = 0;
- /* Modem returns ERROR if there is no SIM in slot. */
+ /* There is probably no SIM if SIM is not ready after 5 seconds. */
data->have_sim = ok;
ofono_modem_set_powered(modem, TRUE);