Add the current error state to properties
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 30 Jun 2009 20:23:05 +0000 (13:23 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 30 Jun 2009 20:23:05 +0000 (13:23 -0700)
doc/service-api.txt
src/service.c

index cf45999..ae788a3 100644 (file)
@@ -97,7 +97,7 @@ Properties    string State [readonly]
                        the "failure" state. Otherwise it might be empty or
                        not present at all.
 
-                       The detailed error codes will be defined later.
+                       Current defined error code is "dhcp-failed".
 
                string Name [readonly]
 
index f2886cf..e166460 100644 (file)
@@ -300,6 +300,11 @@ static DBusMessage *get_properties(DBusConnection *conn,
                connman_dbus_dict_append_variant(&dict, "State",
                                                DBUS_TYPE_STRING, &str);
 
+       str = error2string(service->error);
+       if (str != NULL)
+               connman_dbus_dict_append_variant(&dict, "Error",
+                                               DBUS_TYPE_STRING, &str);
+
        if (service->strength > 0)
                connman_dbus_dict_append_variant(&dict, "Strength",
                                        DBUS_TYPE_BYTE, &service->strength);