X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-proto-ws.h;h=506960eab1ed9149c6c884bb364b9a11453cfa26;hb=6f13ad1989875b5a0ce50b24211fd1fba093735f;hp=b5f84e9e25a6deacf78ec55a4a16b8aa2bfa9fd4;hpb=95ad0012182b5f32cc1dd9843304b58d263a7de0;p=src%2Fapp-framework-binder.git diff --git a/src/afb-proto-ws.h b/src/afb-proto-ws.h index b5f84e9e..506960ea 100644 --- a/src/afb-proto-ws.h +++ b/src/afb-proto-ws.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016, 2017, 2018 "IoT.bzh" + * Copyright (C) 2016-2019 "IoT.bzh" * Author: José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -29,6 +29,8 @@ struct afb_proto_ws; struct afb_proto_ws_call; struct afb_proto_ws_describe; +typedef unsigned char afb_proto_ws_uuid_t[16]; + struct afb_proto_ws_client_itf { /* can't be NULL */ @@ -40,7 +42,7 @@ struct afb_proto_ws_client_itf void (*on_event_subscribe)(void *closure, void *request, const char *event_name, int event_id); void (*on_event_unsubscribe)(void *closure, void *request, const char *event_name, int event_id); void (*on_event_push)(void *closure, const char *event_name, int event_id, struct json_object *data); - void (*on_event_broadcast)(void *closure, const char *event_name, struct json_object *data); + void (*on_event_broadcast)(void *closure, const char *event_name, struct json_object *data, const afb_proto_ws_uuid_t uuid, uint8_t hop); }; struct afb_proto_ws_server_itf @@ -61,7 +63,7 @@ extern int afb_proto_ws_is_server(struct afb_proto_ws *protows); extern void afb_proto_ws_hangup(struct afb_proto_ws *protows); extern void afb_proto_ws_on_hangup(struct afb_proto_ws *protows, void (*on_hangup)(void *closure)); -extern void afb_proto_ws_set_queuing(struct afb_proto_ws *protows, int (*queuing)(void (*)(int,void*), void*)); +extern void afb_proto_ws_set_queuing(struct afb_proto_ws *protows, int (*queuing)(struct afb_proto_ws *, void (*)(int,void*), void*)); extern int afb_proto_ws_client_call(struct afb_proto_ws *protows, const char *verb, struct json_object *args, const char *sessionid, void *request, const char *user_creds); @@ -70,7 +72,7 @@ extern int afb_proto_ws_client_describe(struct afb_proto_ws *protows, void (*cal extern int afb_proto_ws_server_event_create(struct afb_proto_ws *protows, const char *event_name, int event_id); extern int afb_proto_ws_server_event_remove(struct afb_proto_ws *protows, const char *event_name, int event_id); extern int afb_proto_ws_server_event_push(struct afb_proto_ws *protows, const char *event_name, int event_id, struct json_object *data); -extern int afb_proto_ws_server_event_broadcast(struct afb_proto_ws *protows, const char *event_name, struct json_object *data); +extern int afb_proto_ws_server_event_broadcast(struct afb_proto_ws *protows, const char *event_name, struct json_object *data, const afb_proto_ws_uuid_t uuid, uint8_t hop); extern void afb_proto_ws_call_addref(struct afb_proto_ws_call *call); extern void afb_proto_ws_call_unref(struct afb_proto_ws_call *call);