diff options
author | Rémi Denis-Courmont <remi.denis-courmont@nokia.com> | 2011-01-20 10:37:50 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-01-20 12:09:18 +0100 |
commit | 8ccbc9e515fb3ca7854767aa7a5aa1c696090366 (patch) | |
tree | d8aaa21c8e91474c85a5876293975622febcb2d1 | |
parent | 184c1594c8fc757bb58fd2c440c6f2e91e753b90 (diff) | |
download | ofono-8ccbc9e515fb3ca7854767aa7a5aa1c696090366.tar.bz2 |
gprs: Core support for packet switched bearer reporting
-rw-r--r-- | src/gprs.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -67,6 +67,7 @@ struct ofono_gprs { ofono_bool_t suspended; int status; int flags; + int bearer; guint suspend_timeout; struct idmap *pid_map; unsigned int last_context_id; @@ -1319,6 +1320,8 @@ static void gprs_attached_update(struct ofono_gprs *gprs) OFONO_CONNECTION_CONTEXT_INTERFACE, "Active", DBUS_TYPE_BOOLEAN, &value); } + + gprs->bearer = -1; } path = __ofono_atom_get_path(gprs->atom); @@ -1433,6 +1436,13 @@ static DBusMessage *gprs_get_properties(DBusConnection *conn, value = gprs->attached; ofono_dbus_dict_append(&dict, "Attached", DBUS_TYPE_BOOLEAN, &value); + if (gprs->bearer != -1) { + const char *bearer = packet_bearer_to_string(gprs->bearer); + + ofono_dbus_dict_append(&dict, "Bearer", + DBUS_TYPE_STRING, &bearer); + } + value = gprs->roaming_allowed; ofono_dbus_dict_append(&dict, "RoamingAllowed", DBUS_TYPE_BOOLEAN, &value); @@ -1979,6 +1989,23 @@ void ofono_gprs_add_context(struct ofono_gprs *gprs, __ofono_atom_register(gc->atom, gprs_context_unregister); } +void ofono_gprs_bearer_notify(struct ofono_gprs *gprs, int bearer) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + const char *path; + const char *value; + + if (gprs->bearer == bearer) + return; + + gprs->bearer = bearer; + path = __ofono_atom_get_path(gprs->atom); + value = packet_bearer_to_string(bearer); + ofono_dbus_signal_property_changed(conn, path, + OFONO_CONNECTION_CONTEXT_INTERFACE, + "Bearer", DBUS_TYPE_STRING, &value); +} + void ofono_gprs_context_deactivated(struct ofono_gprs_context *gc, unsigned int cid) { |