X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-proto-ws.h;h=d674af3df44fa9f5d052f0d3fe44847ec914e182;hb=c8558c8a28966110aa3a356f95d3c60afe32b64a;hp=a3d4a0dd9793c4bfdcfa20846fa7ff1506593a75;hpb=d7933c0f61a3316cc3d1ca7e74d30e193de2f612;p=src%2Fapp-framework-binder.git diff --git a/src/afb-proto-ws.h b/src/afb-proto-ws.h index a3d4a0dd..d674af3d 100644 --- a/src/afb-proto-ws.h +++ b/src/afb-proto-ws.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016, 2017 "IoT.bzh" + * Copyright (C) 2016, 2017, 2018 "IoT.bzh" * Author: José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,6 +18,7 @@ #pragma once +struct fdev; struct afb_proto_ws; struct afb_proto_ws_call; struct afb_proto_ws_subcall; @@ -25,9 +26,11 @@ struct afb_proto_ws_describe; struct afb_proto_ws_client_itf { + /* can't be NULL */ void (*on_reply_success)(void *closure, void *request, struct json_object *result, const char *info); void (*on_reply_fail)(void *closure, void *request, const char *status, const char *info); + /* can be NULL */ void (*on_event_create)(void *closure, const char *event_name, int event_id); void (*on_event_remove)(void *closure, const char *event_name, int event_id); void (*on_event_subscribe)(void *closure, void *request, const char *event_name, int event_id); @@ -44,8 +47,8 @@ struct afb_proto_ws_server_itf void (*on_describe)(void *closure, struct afb_proto_ws_describe *describe); }; -extern struct afb_proto_ws *afb_proto_ws_create_client(int fd, const struct afb_proto_ws_client_itf *itf, void *closure); -extern struct afb_proto_ws *afb_proto_ws_create_server(int fd, const struct afb_proto_ws_server_itf *itf, void *closure); +extern struct afb_proto_ws *afb_proto_ws_create_client(struct fdev *fdev, const struct afb_proto_ws_client_itf *itf, void *closure); +extern struct afb_proto_ws *afb_proto_ws_create_server(struct fdev *fdev, const struct afb_proto_ws_server_itf *itf, void *closure); extern void afb_proto_ws_unref(struct afb_proto_ws *protows); extern void afb_proto_ws_addref(struct afb_proto_ws *protows);