aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-api-dbus.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-06-17 22:31:33 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2016-06-23 11:04:23 +0200
commitd8ef25780bffa6f91f013ef71b1ede908325e59d (patch)
treefb0d3aef9cdf0775dcadd2c062741519c4d4fcad /src/afb-api-dbus.c
parentb0848149c1ef5236791c0ba5196540d05d9f15fd (diff)
evt: handles broadcasting and tracking
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-api-dbus.c')
-rw-r--r--src/afb-api-dbus.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/afb-api-dbus.c b/src/afb-api-dbus.c
index 3d9da07f..054755ac 100644
--- a/src/afb-api-dbus.c
+++ b/src/afb-api-dbus.c
@@ -537,7 +537,7 @@ static int api_dbus_server_on_object_called(sd_bus_message *message, void *userd
return 1;
}
-static void afb_api_dbus_server_send_event(struct api_dbus *api, const char *event, struct json_object *object)
+static void afb_api_dbus_server_send_event(struct api_dbus *api, const char *event, int eventid, struct json_object *object)
{
int rc;
@@ -548,6 +548,12 @@ static void afb_api_dbus_server_send_event(struct api_dbus *api, const char *eve
json_object_put(object);
}
+/* the interface for events */
+static const struct afb_evt_itf evt_itf = {
+ .broadcast = (void*)afb_api_dbus_server_send_event,
+ .push = (void*)afb_api_dbus_server_send_event
+};
+
/* create the service */
int afb_api_dbus_add_server(const char *path)
{
@@ -576,7 +582,7 @@ int afb_api_dbus_add_server(const char *path)
}
INFO("afb service over dbus installed, name %s, path %s", api->name, api->path);
- api->listener = afb_evt_listener_create((void*)afb_api_dbus_server_send_event, api);
+ api->listener = afb_evt_listener_create(&evt_itf, api);
return 0;
error3: