From aad4d0de78d6928ae6fd4364262c3d0021959a9d Mon Sep 17 00:00:00 2001 From: Andrzej Zaborowski Date: Fri, 9 Apr 2010 08:49:01 +0200 Subject: Add Sim Toolkit atom - Add ofono_stk atom in stk.c - Move envelope command from sim driver to stk driver --- src/cbs.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/cbs.c') diff --git a/src/cbs.c b/src/cbs.c index 2fa33c1f..ff343e31 100644 --- a/src/cbs.c +++ b/src/cbs.c @@ -57,6 +57,7 @@ struct ofono_cbs { GSList *topics; GSList *new_topics; struct ofono_sim *sim; + struct ofono_stk *stk; struct ofono_netreg *netreg; unsigned int netreg_watch; unsigned int location_watch; @@ -195,7 +196,7 @@ void ofono_cbs_notify(struct ofono_cbs *cbs, const unsigned char *pdu, } if (cbs_topic_in_range(c.message_identifier, cbs->efcbmid_contents)) { - __ofono_cbs_sim_download(cbs->sim, pdu, pdu_len); + __ofono_cbs_sim_download(cbs->stk, pdu, pdu_len); return; } @@ -590,6 +591,7 @@ static void cbs_unregister(struct ofono_atom *atom) } cbs->sim = NULL; + cbs->stk = NULL; if (cbs->reset_source) { g_source_remove(cbs->reset_source); @@ -1027,6 +1029,7 @@ void ofono_cbs_register(struct ofono_cbs *cbs) struct ofono_modem *modem = __ofono_atom_get_modem(cbs->atom); const char *path = __ofono_atom_get_path(cbs->atom); struct ofono_atom *sim_atom; + struct ofono_atom *stk_atom; struct ofono_atom *netreg_atom; if (!g_dbus_register_interface(conn, path, @@ -1050,6 +1053,11 @@ void ofono_cbs_register(struct ofono_cbs *cbs) cbs_got_imsi(cbs); } + stk_atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_SIM); + + if (stk_atom) + cbs->stk = __ofono_atom_get_data(stk_atom); + cbs->netreg_watch = __ofono_modem_add_atom_watch(modem, OFONO_ATOM_TYPE_NETREG, netreg_watch, cbs, NULL); -- cgit v1.2.3