Add Device property to network objects
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 17 Dec 2008 20:53:04 +0000 (21:53 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 17 Dec 2008 20:53:04 +0000 (21:53 +0100)
doc/network-api.txt
src/element.c

index b38e122..ce487dd 100644 (file)
@@ -55,6 +55,11 @@ Properties   string Name [readonly]
 
                        Indicates the signal strength of the network.
 
+               object Device [readonly]
+
+                       The object path of the device this networks
+                       belongs to.
+
                array{byte} WiFi.SSID [readonly]
 
                        If the network type is WiFi, then this property is
index c2cf05f..6c07046 100644 (file)
@@ -696,6 +696,10 @@ static DBusMessage *network_get_properties(DBusConnection *conn,
                        DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
                        DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict);
 
+       if (element->parent)
+               connman_dbus_dict_append_variant(&dict, "Device",
+                               DBUS_TYPE_OBJECT_PATH, &element->parent->path);
+
        str = __connman_element_policy2string(element->policy);
        if (str != NULL)
                connman_dbus_dict_append_variant(&dict, "Policy",