diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-07-09 17:06:59 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-07-14 15:45:04 -0500 |
commit | acc65afceed3e5abdad3fe8a560161f67c28f7de (patch) | |
tree | 0fcfdc87825cb1f379d0b35601fd97e90e797bc8 /src/sim.c | |
parent | 165a78e7e9f5bda0868adbd572763773a7f3322e (diff) | |
download | ofono-acc65afceed3e5abdad3fe8a560161f67c28f7de.tar.bz2 |
Add get/set sim readiness functions
Diffstat (limited to 'src/sim.c')
-rw-r--r-- | src/sim.c | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -49,6 +49,7 @@ struct sim_manager_data { char *imsi; GSList *own_numbers; GSList *ready_notify; + gboolean ready; int dcbyte; @@ -819,9 +820,36 @@ void ofono_sim_ready_notify_unregister(struct ofono_modem *modem, g_slist_remove(modem->sim_manager->ready_notify, cb); } +int ofono_sim_get_ready(struct ofono_modem *modem) +{ + if (modem->sim_manager == NULL) + return 0; + + if (modem->sim_manager->ready == TRUE) + return 1; + return 0; } +void ofono_sim_set_ready(struct ofono_modem *modem) +{ + GSList *l; + + if (modem->sim_manager == NULL) + return; + + if (modem->sim_manager->ready == TRUE) + return; + + modem->sim_manager->ready = TRUE; + + for (l = modem->sim_manager->ready_notify; l; l = l->next) { + ofono_sim_ready_notify_cb_t cb = l->data; + + cb(modem); + } +} + int ofono_sim_manager_register(struct ofono_modem *modem, struct ofono_sim_ops *ops) { |