From a12d252609e61a79a49f38de51fd8e809f526a9b Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 22 Oct 2009 18:35:44 -0500 Subject: [PATCH] Add stub of gprs context deactivated --- src/gprs.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/gprs.c b/src/gprs.c index 54b6730..3124ea2 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -66,6 +66,12 @@ struct ofono_gprs { struct ofono_atom *atom; }; +struct ofono_gprs_context { + struct ofono_gprs *gprs; + const struct ofono_gprs_context_driver *driver; + void *driver_data; +}; + struct pri_context { ofono_bool_t active; enum gprs_context_type type; @@ -893,6 +899,32 @@ void ofono_gprs_set_cid_range(struct ofono_gprs *gprs, int min, int max) gprs->cid_max = max; } +void ofono_gprs_context_deactivated(struct ofono_gprs_context *gc, unsigned cid) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + GSList *l; + struct pri_context *ctx; + dbus_bool_t value; + + for (l = gc->gprs->contexts; l; l = l->next) { + ctx = l->data; + + if (ctx->active == FALSE) + continue; + + if (ctx->context.cid != cid) + continue; + + ctx->active = FALSE; + + value = FALSE; + ofono_dbus_signal_property_changed(conn, ctx->path, + DATA_CONTEXT_INTERFACE, + "Active", DBUS_TYPE_BOOLEAN, + &value); + } +} + int ofono_gprs_driver_register(const struct ofono_gprs_driver *d) { DBG("driver: %p, name: %s", d, d->name); -- 2.7.4