From 379708307921a5bab2867c80326099383154bd9f Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期四, 04 二月 2021 15:53:16 +0800
Subject: [PATCH] add recvandsend interface
---
libcbhomebus.h | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/libcbhomebus.h b/libcbhomebus.h
index 0ffdf89..44f8bb2 100644
--- a/libcbhomebus.h
+++ b/libcbhomebus.h
@@ -28,6 +28,11 @@
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;
+// add recvandsend funcs
+static tfn_net_mod_socket_recvandsend fn_socket_recvandsend = NULL;
+static tfn_net_mod_socket_recvandsend_timeout fn_socket_recvandsend_timeout = NULL;
+static tfn_net_mod_socket_recvandsend_nowait fn_socket_recvandsend_nowait = 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;
@@ -75,6 +80,11 @@
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";
+// add recvandsend funcs
+const static char l_net_mod_socket_recvandsend[] = "net_mod_socket_recvandsend";
+const static char l_net_mod_socket_recvandsend_timeout[] = "net_mod_socket_recvandsend_timeout";
+const static char l_net_mod_socket_recvandsend_nowait[] = "net_mod_socket_recvandsend_nowait";
+
//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";
@@ -129,6 +139,11 @@
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) ;
+// add recvandsend funcs
+typedef void(*recv_callback_fn)(void**, int*);
+int wrap_fn_socket_recvandsend(hbhomebus lib, void *_sockt, recvandsend_callback_fn fn, void *user_data);
+int wrap_fn_socket_recvandsend_timeout(hbhomebus lib, void *_sockt, recvandsend_callback_fn fn, int sec, int nsec, void *user_data);
+int wrap_fn_socket_recvandsend_nowait (hbhomebus lib, void *_sockt, recvandsend_callback_fn fn, void *user_data);
//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);
--
Gitblit v1.8.0