From 18f11f4e1dbfce53675c40dcde907f11d32cce43 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 30 Jun 2009 13:23:05 -0700 Subject: [PATCH] Add the current error state to properties --- doc/service-api.txt | 2 +- src/service.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/service-api.txt b/doc/service-api.txt index cf45999..ae788a3 100644 --- a/doc/service-api.txt +++ b/doc/service-api.txt @@ -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] diff --git a/src/service.c b/src/service.c index f2886cf..e166460 100644 --- a/src/service.c +++ b/src/service.c @@ -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); -- 2.7.4