Hi Antara,

On 03/06/2019 05:54 AM, Antara Borwankar wrote:
added code to enable and initialize stk in xmm7modem plugin
---
  plugins/xmm7xxx.c | 10 ++++++++++
  1 file changed, 10 insertions(+)

diff --git a/plugins/xmm7xxx.c b/plugins/xmm7xxx.c
index 90e52fb..83ed263 100644
--- a/plugins/xmm7xxx.c
+++ b/plugins/xmm7xxx.c
@@ -1223,6 +1223,16 @@ static void xmm7xxx_pre_sim(struct ofono_modem *modem)
        DBG("%p", modem);
ofono_devinfo_create(modem, OFONO_VENDOR_IFX, "atmodem", data->chat);
+
+       ofono_stk_create(modem, 0, "atmodem", data->chat);
+
+       /*      enabling stk    */
+       g_at_chat_send(data->chat,
+               "AT+CFUN=6", none_prefix, NULL, NULL, NULL);
+       /*      sim reset to get stk menu command       */
+       g_at_chat_send(data->chat,
+               "AT+CFUN=27,1", none_prefix, NULL, NULL, NULL);
+

So as a general rule, there should be no AT commands in pre_sim/post_sim/post_online. It is almost always not what you want.

So the question is, where do these belong. You're adding them in pre_sim, so logically they might belong as part of the .enable sequence?

I'm guessing this is to work around the issue of powering off and on a modem with a SIM inserted, right? e.g. since the modem is not being brought fully down, it is caching / keeping whatever SIM state it already discovered.

Regards,
-Denis

        data->sim = ofono_sim_create(modem, OFONO_VENDOR_IFX, "atmodem",
                                        data->chat);
  }


_______________________________________________
ofono mailing list
[email protected]
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to