From d8cb16e3a0d8d1483f89ca106b1e31fc7663b31d Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期日, 29 一月 2023 09:31:15 +0800
Subject: [PATCH] bug fixed query_proc
---
main.cpp | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/main.cpp b/main.cpp
index 8811cf0..bcc2f7c 100644
--- a/main.cpp
+++ b/main.cpp
@@ -9,7 +9,7 @@
#include "cbhomeclient.h"
#include "message.h"
-// #include "3dparty/bus_nng/bn_api.h"
+// #include "3rdparty/bus_nng/bn_api.h"
#include "bhome_msg_api.pb.h"
using namespace bhome_msg;
@@ -62,6 +62,11 @@
auto msg = bus_client_get_submsg(handle);
printf("SUB msg topic [%s] data [%s]\n", msg->topic, msg->msg);
free_submsg(msg);
+
+ size_t count = 0;
+ auto p = bus_client_query_procs(handle, &count);
+ printf("bus_client_query_procs size %lu\n", count);
+ free_query_procs(p, count);
}
bus_client_free(handle);
@@ -114,7 +119,7 @@
void* src = NULL;
auto msg = bus_client_get_reqmsg(handle, &src);
auto repmsg = make_reply_msg(0, NULL, 0, "recv request", 12);
- bus_client_reply_msg(handle, src, repmsg);
+ bus_client_reply(handle, src, repmsg);
free_reply_msg(repmsg);
printf("REPREQ msg [%s] \n", msg->msg);
@@ -135,6 +140,7 @@
printf("start RR\n");
const char* rrtopic = "cbhomeclient_req_rep";
thread([&]{ req(rrtopic); }).detach();
+
reply(rrtopic);
return 0;
--
Gitblit v1.8.0