aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Hundebøll <martin@geanix.com>2024-04-30 13:52:25 +0200
committerDenis Kenzior <denkenz@gmail.com>2024-05-02 08:46:43 -0500
commit4b98bea96881a9c582271c102cdfa8335b6e307c (patch)
tree6bf7c4eb07be47ab49d23806ae6deb6711f42d39
parent4e161031a92b1f2fe134ff192ab1b91176e7993f (diff)
downloadofono-4b98bea96881a9c582271c102cdfa8335b6e307c.tar.gz
sim7100: wait for modem to start while enabling
The sim7100_enable() returns 0 just after queuing the AT+CFUN=1 command, which ofono core interprets as the modem being powered up and in pre-sim state. In fact, the pre-sim state isn't reached until the modem returns OK, which is caught in cfun_set_on_cb() in sim7100.c. Delay the transition from off to pre-sim until the respone is received by return EINPROGRESS instead, and let the (existing) ofono_modem_set_powered() call signal pre-sim to ofono core.
-rw-r--r--plugins/sim7100.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/sim7100.c b/plugins/sim7100.c
index 4a1ac7821..b5e658915 100644
--- a/plugins/sim7100.c
+++ b/plugins/sim7100.c
@@ -149,7 +149,7 @@ static int sim7100_enable(struct ofono_modem *modem)
g_at_chat_send(data->at, "AT+CFUN=1", NULL, cfun_set_on_cb,
modem, NULL);
- return 0;
+ return -EINPROGRESS;
}
static void cfun_set_off_cb(gboolean ok, GAtResult *result, gpointer user_data)