From: Marcel Holtmann Date: Sun, 14 Dec 2008 23:44:17 +0000 (+0100) Subject: Add property for connection type X-Git-Tag: 2.0_alpha~4439 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5bb2816373b31c080a944dc957f3f38c1282aedf;p=framework%2Fconnectivity%2Fconnman.git Add property for connection type --- diff --git a/doc/connection-api.txt b/doc/connection-api.txt index 7f3d940..e2cf474 100644 --- a/doc/connection-api.txt +++ b/doc/connection-api.txt @@ -17,7 +17,11 @@ Signals PropertyChanged(string name, variant value) This signal indicates a changed value of the given property. -Properties string IPv4.Method [readonly] +Properties string Type [readonly] + + The connection type (for example wifi etc.) + + string IPv4.Method [readonly] Indicates the way how the IPv4 settings were configured. Possible values here are "dhcp" diff --git a/src/element.c b/src/element.c index 5081ff3..d1e6de3 100644 --- a/src/element.c +++ b/src/element.c @@ -679,12 +679,13 @@ static DBusMessage *network_set_property(DBusConnection *conn, return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); } -static DBusMessage *get_connection_properties(DBusConnection *conn, +static DBusMessage *connection_get_properties(DBusConnection *conn, DBusMessage *msg, void *data) { struct connman_element *element = data; DBusMessage *reply; DBusMessageIter array, dict; + const char *str; DBG("conn %p", conn); @@ -699,6 +700,11 @@ static DBusMessage *get_connection_properties(DBusConnection *conn, DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict); + str = subtype2string(element->subtype); + if (str != NULL) + connman_dbus_dict_append_variant(&dict, "Type", + DBUS_TYPE_STRING, &str); + add_common_properties(element, &dict); dbus_message_iter_close_container(&array, &dict); @@ -724,7 +730,7 @@ static GDBusMethodTable network_methods[] = { }; static GDBusMethodTable connection_methods[] = { - { "GetProperties", "", "a{sv}", get_connection_properties }, + { "GetProperties", "", "a{sv}", connection_get_properties }, { }, };