summaryrefslogtreecommitdiffstats
path: root/src/afb-monitor.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-08-11 11:08:56 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-08-11 16:50:43 +0200
commit53c7b44e96e6015a4da4f88f22e98b13cfa2e056 (patch)
treec6063d881e53866871845fda199e12a7d14ae3b3 /src/afb-monitor.c
parentec68c44857603c9f5bb77a44d8163d837ac5a55a (diff)
afb-apiset: add a wrapper for 'describe'
And use it in monitor. Change-Id: I9efbd19cfbdc665d1d686831b529ebaa7bd917a2 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-monitor.c')
-rw-r--r--src/afb-monitor.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/afb-monitor.c b/src/afb-monitor.c
index 7524d24e..369c5bf5 100644
--- a/src/afb-monitor.c
+++ b/src/afb-monitor.c
@@ -239,14 +239,10 @@ static struct json_object *get_verbosity(struct json_object *spec)
static void get_one_api(struct json_object *resu, const char *name, struct json_object *spec)
{
struct json_object *o;
- struct afb_api api;
- int rc;
- rc = afb_apiset_lookup(main_apiset, name, &api);
- if (!rc) {
- o = api.itf->describe ? api.itf->describe(api.closure) : NULL;
+ o = afb_apiset_describe(main_apiset, name);
+ if (o || afb_apiset_has(main_apiset, name))
json_object_object_add(resu, name, o);
- }
}
/**