On 12/03/2012 12:40 PM, Jonas Bonn wrote:
So, my thinking is that we need to do something like this:
i) At telit_enable, set CFUN=1 and wait for QSS=2 or QSS=3.
ii) When we get QSS=2 or QSS=3 then we can set SIM_READY state so that
post_sim gets called... this should be called after all the IMSI
querying, etc. (right?)
iii) Once we're in SIM_READY state, we set CFUN=4... this is the 'end'
of the 'telit_enable' phase
iv) While in CFUN=4 state, we ignore QSS: 0
V) This should result in the GPRS interface being exported so that
connman can call 'online' call which will result in the switch to the
"real" CFUN=1
I gave this a try with the HE910 from Telit and the following works (not
in git format, this is just for reference... I will resubmit it later
after comment). Just note that it takes about 1 min for the SIM to
reach "ready" state after power up.
This also doesn't account for QSS: 0 occurring during 'offline' state...
need to check what happens there.
Comments?
diff --git a/plugins/telit.c b/plugins/telit.c
index fe2ccd6..40d72fe 100644
--- a/plugins/telit.c
+++ b/plugins/telit.c
@@ -339,7 +339,7 @@ static int telit_enable(struct ofono_modem *modem)
g_at_chat_send(data->chat, "AT#QSS=0", none_prefix, NULL, NULL,
NULL);
/* Set phone functionality */
- g_at_chat_send(data->chat, "AT+CFUN=4", none_prefix,
+ g_at_chat_send(data->chat, "AT+CFUN=1", none_prefix,
cfun_enable_cb, modem, NULL);
return -EINPROGRESS;
@@ -565,6 +565,16 @@ static void telit_post_sim(struct ofono_modem *modem)
if (gprs && gc)
ofono_gprs_add_context(gprs, gc);
+
+ /*
+ * We need the modem in CFUN!=4 state in order to get to
+ * post_sim... now we can check if we really should be offline
+ * and, if so, set CFUN=4
+ */
+ if (!ofono_modem_get_online(modem)) {
+ g_at_chat_send(data->chat, "AT+CFUN=4", none_prefix,
+ NULL, NULL, NULL);
+ }
}
static void set_online_cb(gboolean ok, GAtResult *result, gpointer
user_data)
/Jonas
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono