projects
/
platform
/
upstream
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
eb5996f
)
client: Use D-Bus helpers for Technology Scan method call
author
Patrik Flykt
<patrik.flykt@linux.intel.com>
Wed, 27 Mar 2013 11:54:00 +0000
(13:54 +0200)
committer
Patrik Flykt
<patrik.flykt@linux.intel.com>
Thu, 4 Apr 2013 07:26:14 +0000
(10:26 +0300)
client/commands.c
patch
|
blob
|
history
diff --git
a/client/commands.c
b/client/commands.c
index
8ab299a
..
f6abdbb
100644
(file)
--- a/
client/commands.c
+++ b/
client/commands.c
@@
-244,10
+244,24
@@
static int cmd_technologies(char *args[], int num, struct option *options)
technology_print, NULL, DBUS_TYPE_INVALID);
}
technology_print, NULL, DBUS_TYPE_INVALID);
}
+static void scan_return(DBusMessageIter *iter, const char *error,
+ void *user_data)
+{
+ char *path = user_data;
+
+ if (error == NULL) {
+ char *str = strrchr(path, '/');
+ str++;
+ fprintf(stdout, "Scan completed for %s\n", str);
+ } else
+ fprintf(stderr, "Error %s: %s", path, error);
+
+ g_free(user_data);
+}
+
static int cmd_scan(char *args[], int num, struct option *options)
{
static int cmd_scan(char *args[], int num, struct option *options)
{
- DBusMessage *message;
- int err;
+ char *path;
if (num > 2)
return -E2BIG;
if (num > 2)
return -E2BIG;
@@
-255,16
+269,10
@@
static int cmd_scan(char *args[], int num, struct option *options)
if (num < 2)
return -EINVAL;
if (num < 2)
return -EINVAL;
- message = get_message(connection, "GetTechnologies");
- if (message == NULL)
- err = -ENOMEM;
- else {
- err = scan_technology(connection, message, args[1]);
- if (err == 0)
- printf("Scan completed\n");
- }
-
- return 0;
+ path = g_strdup_printf("/net/connman/technology/%s", args[1]);
+ return __connmanctl_dbus_method_call(connection, path,
+ "net.connman.Technology", "Scan",
+ scan_return, path, DBUS_TYPE_INVALID);
}
static void connect_return(DBusMessageIter *iter, const char *error,
}
static void connect_return(DBusMessageIter *iter, const char *error,