From 04241c8168fe8826b4fc7a80500577b50936b57a Mon Sep 17 00:00:00 2001 From: José Bollo Date: Tue, 10 Oct 2017 18:21:54 +0200 Subject: Add the function afb_req_get_uid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I9caf38ee3811cf10b546489094f0bb5b3d844c40 Signed-off-by: José Bollo --- bindings/samples/HelloWorld.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bindings') diff --git a/bindings/samples/HelloWorld.c b/bindings/samples/HelloWorld.c index 0b0d1a96..134ea620 100644 --- a/bindings/samples/HelloWorld.c +++ b/bindings/samples/HelloWorld.c @@ -428,6 +428,12 @@ static void appid (afb_req request) free(aid); } +static void uid (afb_req request) +{ + int uid = afb_req_get_uid(request); + afb_req_success_f(request, json_object_new_int(uid), "uid is %d", uid); +} + static int preinit() { AFB_NOTICE("hello binding comes to live"); @@ -468,6 +474,7 @@ static const afb_verb_v2 verbs[]= { { .verb="broadcast", .callback=broadcast }, { .verb="hasperm", .callback=hasperm }, { .verb="appid", .callback=appid }, + { .verb="uid", .callback=uid }, { .verb="exit", .callback=exitnow }, { .verb=NULL} }; -- cgit 1.2.3-korg