diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-12-14 13:00:49 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-12-14 13:00:57 +0100 |
commit | a69f062cbd4041229f8d29ef9647bf783df414c1 (patch) | |
tree | 8bd1b500273b62708f51690d985397fada56337b /examples | |
parent | d366a6de839087d8a17e5855c14ae55e95b13c65 (diff) | |
download | ubus-a69f062cbd4041229f8d29ef9647bf783df414c1.tar.gz |
ubus: add notification for subscribers present/gone
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/client.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/client.c b/examples/client.c index 315a8e3..418fb15 100644 --- a/examples/client.c +++ b/examples/client.c @@ -18,7 +18,14 @@ static struct ubus_context *ctx; static struct blob_buf b; -static struct ubus_object test_client_object = {}; +static void test_client_subscribe_cb(struct ubus_context *ctx, struct ubus_object *obj) +{ + fprintf(stderr, "Subscribers active: %d\n", obj->has_subscribers); +} + +static struct ubus_object test_client_object = { + .subscribe_cb = test_client_subscribe_cb, +}; static void client_main(void) { |