From e3d8ac1ce502e5a5f9dc762da301b0060b641811 Mon Sep 17 00:00:00 2001 From: chenshijun <csj_sky@126.com> Date: 星期一, 07 十二月 2020 15:56:42 +0800 Subject: [PATCH] 修改适配新的版本接口 --- libcbhomebus.h | 33 ++++++++++++++++++++++++--------- 1 files changed, 24 insertions(+), 9 deletions(-) diff --git a/libcbhomebus.h b/libcbhomebus.h index d637d63..0ffdf89 100644 --- a/libcbhomebus.h +++ b/libcbhomebus.h @@ -28,7 +28,7 @@ static tfn_net_mod_socket_sendandrecv fn_socket_sendandrecv = NULL; static tfn_net_mod_socket_sendandrecv_timeout fn_socket_sendandrecv_timeout = NULL; static tfn_net_mod_socket_sendandrecv_nowait fn_socket_sendandrecv_nowait = NULL; -static tfn_net_mod_socket_start_bus fn_socket_start_bus = NULL; +//static tfn_net_mod_socket_start_bus fn_socket_start_bus = NULL; static tfn_net_mod_socket_pub fn_socket_pub = NULL; static tfn_net_mod_socket_pub_timeout fn_socket_pub_timeout = NULL; static tfn_net_mod_socket_pub_nowait fn_socket_pub_nowait = NULL; @@ -47,6 +47,11 @@ static tfn_net_mod_server_socket_open fn_server_socket_open = NULL; static tfn_net_mod_server_socket_close fn_server_socket_close = NULL; static tfn_net_mod_server_socket_start fn_server_socket_start = NULL; + +// bus +static tfn_bus_server_socket_wrapper_open fn_bus_server_socket_open = NULL; +static tfn_bus_server_socket_wrapper_close fn_bus_server_socket_close = NULL; +static tfn_bus_server_socket_wrapper_start_bus fn_bus_server_socket_start = NULL; ////////////////////////////////////////////////////////////////////// // labels @@ -70,7 +75,7 @@ const static char l_net_mod_socket_sendandrecv[] = "net_mod_socket_sendandrecv"; const static char l_net_mod_socket_sendandrecv_timeout[] = "net_mod_socket_sendandrecv_timeout"; const static char l_net_mod_socket_sendandrecv_nowait[] = "net_mod_socket_sendandrecv_nowait"; -const static char l_net_mod_socket_start_bus[] = "net_mod_socket_start_bus"; +//const static char l_net_mod_socket_start_bus[] = "net_mod_socket_start_bus"; const static char l_net_mod_socket_pub[] = "net_mod_socket_pub"; const static char l_net_mod_socket_pub_timeout[] = "net_mod_socket_pub_timeout"; const static char l_net_mod_socket_pub_nowait[] = "net_mod_socket_pub_nowait"; @@ -89,6 +94,11 @@ const static char l_net_mod_server_socket_open[] = "net_mod_server_socket_open"; const static char l_net_mod_server_socket_close[] = "net_mod_server_socket_close"; const static char l_net_mod_server_socket_start[] = "net_mod_server_socket_start"; + +// bus +const static char l_bus_server_socket_wrapper_open[] = "bus_server_socket_wrapper_open"; +const static char l_bus_server_socket_wrapper_close[] = "bus_server_socket_wrapper_close"; +const static char l_bus_server_socket_wrapper_start_bus[] = "bus_server_socket_wrapper_start_bus"; ////////////////////////////////////////////////////////////////////// // dlopen dynamic library @@ -119,16 +129,16 @@ void ** recv_arr, int *recv_arr_size, int timeout); int wrap_fn_socket_sendandrecv_nowait(hbhomebus lib, void *_sockt, void *node_arr, int arrlen, void *send_buf, int send_size, void ** recv_arr, int *recv_arr_size) ; -int wrap_fn_socket_start_bus(hbhomebus lib, void * _socket); +//int wrap_fn_socket_start_bus(hbhomebus lib, void * _socket); int wrap_fn_socket_pub(hbhomebus lib, void *_sockt, void *node_arr, int node_arr_len, char *topic, int topic_size, void *content, int content_size); int wrap_fn_socket_pub_timeout(hbhomebus lib, void *_sockt, void *node_arr, int node_arr_len, char *topic, int topic_size, void *content, int content_size, int timeout); int wrap_fn_socket_pub_nowait(hbhomebus lib, void *_sockt, void *node_arr, int node_arr_len, char *topic, int topic_size, void *content, int content_size); -int wrap_fn_socket_sub(hbhomebus lib, void * _socket, void *topic, int size, int key); -int wrap_fn_socket_sub_timeout(hbhomebus lib, void * _socket, void *topic, int size, int key, int sec, int nsec); -int wrap_fn_socket_sub_nowait(hbhomebus lib, void * _socket, void *topic, int size, int key); -int wrap_fn_socket_desub(hbhomebus lib, void * _socket, void *topic, int size, int key); -int wrap_fn_socket_desub_timeout(hbhomebus lib, void * _socket, void *topic, int size, int key, int sec, int nsec); -int wrap_fn_socket_desub_nowait(hbhomebus lib, void * _socket, void *topic, int size, int key); +int wrap_fn_socket_sub(hbhomebus lib, void * _socket, void *topic, int size); +int wrap_fn_socket_sub_timeout(hbhomebus lib, void * _socket, void *topic, int size, int sec, int nsec); +int wrap_fn_socket_sub_nowait(hbhomebus lib, void * _socket, void *topic, int size); +int wrap_fn_socket_desub(hbhomebus lib, void * _socket, void *topic, int size); +int wrap_fn_socket_desub_timeout(hbhomebus lib, void * _socket, void *topic, int size, int sec, int nsec); +int wrap_fn_socket_desub_nowait(hbhomebus lib, void * _socket, void *topic, int size); int wrap_fn_socket_get_key(hbhomebus lib, void * _socket) ; void wrap_fn_socket_free_recv_msg_arr(hbhomebus lib, void * arr, int size); void wrap_fn_socket_free(hbhomebus lib, void *buf) ; @@ -140,6 +150,11 @@ void wrap_fn_server_socket_close(hbhomebus lib, void* _socket); int wrap_fn_server_socket_start(hbhomebus lib, void* _socket); +//bus +void *wrap_fn_bus_server_socket_open(hbhomebus lib); +void wrap_fn_bus_server_socket_close(hbhomebus lib, void* _socket); +int wrap_fn_bus_server_socket_start(hbhomebus lib, void* _socket); + #ifdef __cplusplus } #endif -- Gitblit v1.8.0