summaryrefslogtreecommitdiffstats
path: root/bindings/samples
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-07-27 17:38:22 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2018-08-02 15:49:43 +0200
commit5ef271effacb83552f9ea56572c751c2f5a556b6 (patch)
tree3d5f6665bde93633b0eb6c648c9ab46951443526 /bindings/samples
parente39610f8c9b2e6bbb8a460f7d7ccccbc5161b4ed (diff)
Add ability to provide binding settings
Change-Id: Iab93a26340fa9743a58ca43cd903bbf31c783e5b Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'bindings/samples')
-rw-r--r--bindings/samples/hello3.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bindings/samples/hello3.c b/bindings/samples/hello3.c
index 7e54e3a9..99a35829 100644
--- a/bindings/samples/hello3.c
+++ b/bindings/samples/hello3.c
@@ -552,6 +552,13 @@ static void queue(afb_req_t request)
afb_api_queue_job(afb_req_get_api(request), queue_cb, request, NULL, 0);
}
+static void settings(afb_req_t request)
+{
+ afb_api_t api = afb_req_get_api(request);
+ struct json_object *object = afb_api_settings(api);
+ afb_req_reply(request, json_object_get(object), NULL, NULL);
+}
+
static void rootdir (afb_req_t request)
{
ssize_t s;
@@ -735,6 +742,7 @@ static const struct afb_verb_v3 verbs[]= {
{ .verb="api", .callback=api},
{ .verb="mute", .callback=mute},
{ .verb="queue", .callback=queue},
+ { .verb="settings", .callback=settings},
{ .verb=NULL}
};