From 5fb901dd157b4a8bbfc3be916c6c1a9d02b5bfa6 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期日, 29 一月 2023 09:56:56 +0800
Subject: [PATCH] robust

---
 cbhomeclient.cpp |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/cbhomeclient.cpp b/cbhomeclient.cpp
index b8b7269..0963c4b 100644
--- a/cbhomeclient.cpp
+++ b/cbhomeclient.cpp
@@ -355,13 +355,16 @@
 
     void* rep = NULL;
     int repl = 0;
-    //auto msg = to_bus<4,5>(ptr(handle), bus_query_procs, pbaddr.data(), pbaddr.size(),
-    //    pbtopic.data(), pbtopic.size(), &rep, &repl, sndto);
+    auto msg = to_bus<4,5>(ptr(handle), bus_query_procs, pbaddr.data(), pbaddr.size(),
+       pbtopic.data(), pbtopic.size(), &rep, &repl, sndto);
 
+    if (msg.empty()) return NULL;
+
+    // bug 宸蹭慨澶嶏紝 鍦� bus_nng 涓�
     // bus_query_procs 鑾峰彇鏁版嵁澶辫触, 鏆傛椂鏀圭敤BHQueryProcs
-    if (!BHQueryProcs(pbaddr.data(), pbaddr.size(), pbtopic.data(), pbtopic.size(), &rep, &repl, sndto)) {
-        return NULL;
-    }
+    // if (!BHQueryProcs(pbaddr.data(), pbaddr.size(), pbtopic.data(), pbtopic.size(), &rep, &repl, sndto)) {
+    //     return NULL;
+    // }
 
     MsgQueryProcReply msgR;
     msgR.ParseFromArray(rep, repl);

--
Gitblit v1.8.0