aboutsummaryrefslogtreecommitdiffstats
path: root/src/afm-main-binding.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-11-14 11:43:46 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2016-11-14 13:54:22 +0100
commita1f7f7d2cd79c9391368d0c017452566a5edc44c (patch)
treee1f507900d7526fec3a3cf3c73671d8260045ad4 /src/afm-main-binding.c
parentb6ac54640c918aecaf2f28edf82f8217154b12f3 (diff)
afm-user-daemon: Adds method "once"
Adds the method "once" that is intended to start an application in local mode if it doesn't already run. Returns the state of the running application. Change-Id: I4dfff06fa2d3e95f13a2436a2f1af9174799ddcf Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afm-main-binding.c')
-rw-r--r--src/afm-main-binding.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/afm-main-binding.c b/src/afm-main-binding.c
index 5141888..e8e08db 100644
--- a/src/afm-main-binding.c
+++ b/src/afm-main-binding.c
@@ -34,6 +34,7 @@ static const char _id_[] = "id";
static const char _install_[] = "install";
static const char _local_[] = "local";
static const char _mode_[] = "mode";
+static const char _once_[] = "once";
static const char _pause_[] = "pause";
static const char _remote_[] = "remote";
static const char _resume_[] = "resume";
@@ -294,6 +295,11 @@ static void start(struct afb_req request)
free(query);
}
+static void once(struct afb_req request)
+{
+ call_appid(request, _once_);
+}
+
static void terminate(struct afb_req request)
{
call_runid(request, _terminate_);
@@ -375,6 +381,7 @@ static const struct afb_verb_desc_v1 verbs[] =
{_runnables_, AFB_SESSION_CHECK, runnables, "Get list of runnable applications"},
{_detail_ , AFB_SESSION_CHECK, detail, "Get the details for one application"},
{_start_ , AFB_SESSION_CHECK, start, "Start an application"},
+ {_once_ , AFB_SESSION_CHECK, once, "Start once an application"},
{_terminate_, AFB_SESSION_CHECK, terminate, "Terminate a running application"},
{_pause_ , AFB_SESSION_CHECK, pause, "Pause a running application"},
{_resume_ , AFB_SESSION_CHECK, resume, "Resume a paused application"},