ussd: Add __ofono_ussd_is_busy

Send SS requires Call Forwarding / Call Settings / Call Barring to check
whether USSD is currently busy.  If it is, then the SIM should be
notified appropriately.

We introduce a function __ofono_ussd_is_busy to help with this.
This commit is contained in:
Yang Gu 2010-09-06 10:19:55 +08:00 committed by Denis Kenzior
parent 0a6637bda6
commit 41d38d76bc
2 changed files with 12 additions and 0 deletions

View File

@ -254,6 +254,7 @@ gboolean __ofono_ussd_passwd_register(struct ofono_ussd *ussd, const char *sc,
ofono_ussd_passwd_cb_t cb, void *data,
ofono_destroy_func destroy);
void __ofono_ussd_passwd_unregister(struct ofono_ussd *ussd, const char *sc);
gboolean __ofono_ussd_is_busy(struct ofono_ussd *ussd);
#include <ofono/netreg.h>

View File

@ -65,6 +65,17 @@ struct ssc_entry {
ofono_destroy_func destroy;
};
gboolean __ofono_ussd_is_busy(struct ofono_ussd *ussd)
{
if (!ussd)
return FALSE;
if (ussd->pending || ussd->state != USSD_STATE_IDLE)
return TRUE;
return FALSE;
}
static struct ssc_entry *ssc_entry_create(const char *sc, void *cb, void *data,
ofono_destroy_func destroy)
{