Hmm, noticed I forgot to declare the new function, which makes the patch kinda
useless.
On Thursday 25 November 2010 17:14:37 Denis-Courmont Remi (Nokia-MS/Helsinki),
you wrote:
> ---
> src/gprs.c | 32 ++++++++++++++++++++++++++++++++
> 1 files changed, 32 insertions(+), 0 deletions(-)
>
> diff --git a/src/gprs.c b/src/gprs.c
> index 3b0733e..0226985 100644
> --- a/src/gprs.c
> +++ b/src/gprs.c
> @@ -107,6 +107,7 @@ struct context_settings {
>
> struct pri_context {
> ofono_bool_t active;
> + int bearer;
> enum ofono_gprs_context_type type;
> char name[MAX_CONTEXT_NAME_LENGTH + 1];
> char message_proxy[MAX_MESSAGE_PROXY_LENGTH + 1];
> @@ -596,6 +597,13 @@ static void append_context_properties(struct
> pri_context *ctx, value = ctx->active;
> ofono_dbus_dict_append(dict, "Active", DBUS_TYPE_BOOLEAN, &value);
>
> + if (ctx->active) {
> + const char *bearer = packet_bearer_to_string(ctx->bearer);
> +
> + ofono_dbus_dict_append(dict, "Bearer",
> + DBUS_TYPE_STRING, &bearer);
> + }
> +
> ofono_dbus_dict_append(dict, "Type", DBUS_TYPE_STRING, &type);
>
> ofono_dbus_dict_append(dict, "Protocol", DBUS_TYPE_STRING, &proto);
> @@ -1591,6 +1599,7 @@ static struct pri_context *add_context(struct
> ofono_gprs *gprs, return NULL;
> }
>
> + context->bearer = -1;
> context->id = id;
>
> DBG("Registering new context");
> @@ -2001,6 +2010,29 @@ void ofono_gprs_add_context(struct ofono_gprs *gprs,
> __ofono_atom_register(gc->atom, gprs_context_unregister);
> }
>
> +void ofono_gprs_context_bearer_notify(struct ofono_gprs_context *gc, int
> cid, + int bearer)
> +{
> + DBusConnection *conn = ofono_dbus_get_connection();
> + GSList *l;
> + const char *value = packet_bearer_to_string(bearer);
> +
> + for (l = gc->gprs->contexts; l; l = l->next) {
> + struct pri_context *ctx = l->data;
> +
> + if (ctx->context.cid != cid)
> + continue;
> +
> + if (ctx->bearer == bearer)
> + continue;
> +
> + ctx->bearer = bearer;
> + ofono_dbus_signal_property_changed(conn, ctx->path,
> + OFONO_CONNECTION_CONTEXT_INTERFACE,
> + "Bearer", DBUS_TYPE_STRING, &value);
> + }
> +}
> +
> void ofono_gprs_context_deactivated(struct ofono_gprs_context *gc,
> unsigned int cid)
> {
--
Rémi Denis-Courmont
Nokia Devices R&D, Maemo Software, Helsinki
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono