Add property to indicate default connections
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 15 Dec 2008 07:09:03 +0000 (08:09 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 15 Dec 2008 07:09:03 +0000 (08:09 +0100)
doc/connection-api.txt
src/element.c

index 7356b34..c39c6d2 100644 (file)
@@ -27,6 +27,11 @@ Properties   string Type [readonly]
 
                        This property is optional and not always present.
 
+               boolean Default [readonly]
+
+                       Indicates if it is a default connection. It is
+                       possible to have multiple default connections.
+
                string IPv4.Method [readonly]
 
                        Indicates the way how the IPv4 settings were
index 9f59de0..1b1e61d 100644 (file)
@@ -330,6 +330,10 @@ static void emit_enabled_signal(DBusConnection *conn,
                iface = CONNMAN_NETWORK_INTERFACE;
                key = "Connected";
                break;
+       case CONNMAN_ELEMENT_TYPE_CONNECTION:
+               iface = CONNMAN_CONNECTION_INTERFACE;
+               key = "Default";
+               break;
        default:
                return;
        }
@@ -712,6 +716,9 @@ static DBusMessage *connection_get_properties(DBusConnection *conn,
                connman_dbus_dict_append_variant(&dict, "Strength",
                                        DBUS_TYPE_BYTE, &element->strength);
 
+       connman_dbus_dict_append_variant(&dict, "Default",
+                                       DBUS_TYPE_BOOLEAN, &element->enabled);
+
        add_common_properties(element, &dict);
 
        dbus_message_iter_close_container(&array, &dict);