summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2013-04-24 13:25:45 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-05-03 17:09:31 +0300
commitf8f4f7e80278d0e6d0711156a81581cc368f64f4 (patch)
tree1394056e0a84888631ca8b3996a0be1d09e8c65b /client
parent21257308893e29c6ea90b79e3bf0f8341ed08bd5 (diff)
downloadconnman-f8f4f7e80278d0e6d0711156a81581cc368f64f4.tar.gz
connman-f8f4f7e80278d0e6d0711156a81581cc368f64f4.tar.bz2
connman-f8f4f7e80278d0e6d0711156a81581cc368f64f4.zip
client: Add agent command
Diffstat (limited to 'client')
-rw-r--r--client/commands.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/client/commands.c b/client/commands.c
index fb44545f..b803afc0 100644
--- a/client/commands.c
+++ b/client/commands.c
@@ -37,6 +37,7 @@
#include "input.h"
#include "services.h"
#include "commands.h"
+#include "agent.h"
static DBusConnection *connection;
@@ -1151,6 +1152,33 @@ static int cmd_monitor(char *args[], int num, struct connman_option *options)
return 0;
}
+static int cmd_agent(char *args[], int num, struct connman_option *options)
+{
+ if (num > 2)
+ return -E2BIG;
+
+ if (num < 2)
+ return -EINVAL;
+
+ switch(parse_boolean(args[1])) {
+ case 0:
+ __connmanctl_agent_unregister(connection);
+ break;
+
+ case 1:
+ if (__connmanctl_agent_register(connection) == -EINPROGRESS)
+ return -EINPROGRESS;
+
+ break;
+
+ default:
+ return -EINVAL;
+ break;
+ }
+
+ return 0;
+}
+
static int cmd_exit(char *args[], int num, struct connman_option *options)
{
return 1;
@@ -1213,6 +1241,8 @@ static const struct {
"Set service configuration options" },
{ "monitor", "[off]", monitor_options, cmd_monitor,
"Monitor signals from interfaces" },
+ { "agent", "on|off", NULL, cmd_agent,
+ "Agent mode" },
{ "help", NULL, NULL, cmd_help,
"Show help" },
{ "exit", NULL, NULL, cmd_exit,