Add priority property to elements
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 2 Jul 2008 18:49:41 +0000 (20:49 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 2 Jul 2008 18:49:41 +0000 (20:49 +0200)
include/element.h
src/element.c

index 1d14424..e584338 100644 (file)
@@ -70,6 +70,7 @@ struct connman_element {
        enum connman_element_type type;
        enum connman_element_subtype subtype;
        enum connman_element_state state;
+       guint16 priority;
 
        struct connman_element *parent;
 
index 0f46d35..c21b505 100644 (file)
@@ -106,6 +106,9 @@ static void append_entry(DBusMessageIter *dict,
        case DBUS_TYPE_UINT16:
                signature = DBUS_TYPE_UINT16_AS_STRING;
                break;
+       case DBUS_TYPE_UINT32:
+               signature = DBUS_TYPE_UINT32_AS_STRING;
+               break;
        case DBUS_TYPE_OBJECT_PATH:
                signature = DBUS_TYPE_OBJECT_PATH_AS_STRING;
                break;
@@ -165,6 +168,10 @@ static DBusMessage *get_properties(DBusConnection *conn,
        if (str != NULL)
                append_entry(&dict, "Subtype", DBUS_TYPE_STRING, &str);
 
+       if (element->priority > 0)
+               append_entry(&dict, "Priority",
+                               DBUS_TYPE_UINT16, &element->priority);
+
        if (element->ipv4.address != NULL)
                append_entry(&dict, "IPv4.Address",
                                DBUS_TYPE_STRING, &element->ipv4.address);