X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=bindings%2Fsamples%2FHelloWorld.c;h=134ea6207c8d540963c9225d064806a442a14056;hb=1c58e6f503606cdb815c67490ec7f5d87723136f;hp=c5a79deb4ceca380fabae8021f626680608d6b8a;hpb=15d0dae1cd6ab982137a7c2848de9303a9c969f0;p=src%2Fapp-framework-binder.git diff --git a/bindings/samples/HelloWorld.c b/bindings/samples/HelloWorld.c index c5a79deb..134ea620 100644 --- a/bindings/samples/HelloWorld.c +++ b/bindings/samples/HelloWorld.c @@ -59,7 +59,7 @@ static int event_del(const char *tag) *p = e->next; /* destroys */ - afb_event_drop(e->event); + afb_event_unref(e->event); free(e); return 0; } @@ -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} };