Tag broadcasted events with UUID and hop
[src/app-framework-binder.git] / src / afb-ws-json1.c
index 9d6bfc3..23160fc 100644 (file)
@@ -47,7 +47,7 @@ struct afb_wsreq;
 static void aws_on_hangup_cb(void *closure, struct afb_wsj1 *wsj1);
 static void aws_on_call_cb(void *closure, const char *api, const char *verb, struct afb_wsj1_msg *msg);
 static void aws_on_push_cb(void *closure, const char *event, int eventid, struct json_object *object);
-static void aws_on_broadcast_cb(void *closure, const char *event, struct json_object *object);
+static void aws_on_broadcast_cb(void *closure, const char *event, struct json_object *object, const uuid_binary_t uuid, uint8_t hop);
 
 /* predeclaration of wsreq callbacks */
 static void wsreq_destroy(struct afb_xreq *xreq);
@@ -208,15 +208,19 @@ static void aws_on_call_cb(void *closure, const char *api, const char *verb, str
        afb_xreq_process(&wsreq->xreq, ws->apiset);
 }
 
+static void aws_on_event(struct afb_ws_json1 *aws, const char *event, struct json_object *object)
+{
+       afb_wsj1_send_event_j(aws->wsj1, event, afb_msg_json_event(event, object));
+}
+
 static void aws_on_push_cb(void *closure, const char *event, int eventid, struct json_object *object)
 {
-       aws_on_broadcast_cb(closure, event, object);
+       aws_on_event(closure, event, object);
 }
 
-static void aws_on_broadcast_cb(void *closure, const char *event, struct json_object *object)
+static void aws_on_broadcast_cb(void *closure, const char *event, struct json_object *object, const uuid_binary_t uuid, uint8_t hop)
 {
-       struct afb_ws_json1 *aws = closure;
-       afb_wsj1_send_event_j(aws->wsj1, event, afb_msg_json_event(event, object));
+       aws_on_event(closure, event, afb_msg_json_event(event, object));
 }
 
 /***************************************************************