summaryrefslogtreecommitdiff
path: root/client/services.c
diff options
context:
space:
mode:
authorZhang zhengguang <zhengguang.zhang@intel.com>2014-07-17 02:37:39 (GMT)
committerZhang zhengguang <zhengguang.zhang@intel.com>2014-07-17 02:37:39 (GMT)
commit1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7 (patch)
tree6e991827d28537f7f40f20786c2354fd04a9fdad /client/services.c
parentfbe905ab58ecc31fe64c410c5f580cadc30e7f04 (diff)
downloadconnman-1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7.zip
connman-1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7.tar.gz
connman-1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7.tar.bz2
Imported Upstream version 1.24upstream/1.24
Diffstat (limited to 'client/services.c')
-rw-r--r--client/services.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/client/services.c b/client/services.c
index 045947c..0c18669 100644
--- a/client/services.c
+++ b/client/services.c
@@ -57,11 +57,17 @@ static void print_service(char *path, DBusMessageIter *iter)
dbus_message_iter_recurse(&entry, &val);
dbus_message_iter_get_basic(&val, &str);
- if (str != NULL) {
+ if (str) {
if (strcmp(str, "online") == 0)
state = 'O';
else if (strcmp(str, "ready") == 0)
state = 'R';
+ else if (!strcmp(str, "association"))
+ state = 'a';
+ else if (!strcmp(str, "configuration"))
+ state = 'c';
+ else if (!strcmp(str, "disconnect"))
+ state = 'd';
}
} else if (strcmp(property, "AutoConnect") == 0) {
@@ -80,18 +86,15 @@ static void print_service(char *path, DBusMessageIter *iter)
}
str = strrchr(path, '/');
- if (str != NULL)
+ if (str)
str++;
else
str = path;
- if (count > 0) {
- if (*name == '\0')
- name = "<hidden>";
-
+ if (count > 0)
fprintf(stdout, "%c%c%c %-20s %s", favorite != 0 ? '*' : ' ',
autoconn != 0 ? 'A' : ' ', state, name, str);
- } else
+ else
fprintf(stdout, "%-24s %s", "unchanged", str);
}
@@ -117,7 +120,7 @@ static void list_service_array(DBusMessageIter *iter)
print_service(path, &dict);
}
- if (dbus_message_iter_has_next(iter) == TRUE)
+ if (dbus_message_iter_has_next(iter))
fprintf(stdout, "\n");
dbus_message_iter_next(iter);