diff options
author | José Bollo <jose.bollo@iot.bzh> | 2016-02-15 11:59:53 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2016-02-15 11:59:53 +0100 |
commit | a0eb62f43459f17961db16256199b4bbb936d863 (patch) | |
tree | cf899ea0bc686648c531723472b0f5cb5eb3e6bb /plugins | |
parent | 1edf05100332c85ee28abc0754fcb825648157c4 (diff) |
afm-main-plugin: adds mode auto
Change-Id: Ic707b52dd6029bd60242f03fcc04b6596f1cb017
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/afm-main-plugin/afm-main-plugin.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/afm-main-plugin/afm-main-plugin.c b/plugins/afm-main-plugin/afm-main-plugin.c index 3f9de713..f6b44a0a 100644 --- a/plugins/afm-main-plugin/afm-main-plugin.c +++ b/plugins/afm-main-plugin/afm-main-plugin.c @@ -38,6 +38,7 @@ static char _uninstall_[] = "uninstall"; static const char _mode_[] = "mode"; static const char _local_[] = "local"; static const char _remote_[]= "remote"; +static const char _auto_[] = "auto"; static const char _uri_[] = "uri"; static struct jbus *jbus; @@ -138,7 +139,7 @@ static struct json_object *call_start(AFB_request *request, AFB_PostItem *item) } /* get the mode */ mode = getQueryValue(request, _mode_); - if (mode == NULL) { + if (mode == NULL || !strcmp(mode, _auto_)) { mode = request->config->mode == AFB_MODE_REMOTE ? _remote_ : _local_; } |