From b0598b2b53dc72ca7e259b993c1a13cf7de1e59a Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期四, 20 五月 2021 10:01:03 +0800
Subject: [PATCH] bhsgo实现QueryProcs

---
 hbusc.go |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/hbusc.go b/hbusc.go
index b168723..a09ea0e 100644
--- a/hbusc.go
+++ b/hbusc.go
@@ -274,9 +274,15 @@
 	return errors.New("reply return false")
 }
 
-func (h *BHBus) RequestCenter(req *bhome_msg.MsgRequestTopic) (*Reply, error) {
-
-	return nil, errors.New("")
+func (h *BHBus) RequestCenter() ([]*bhome_msg.MsgQueryProcReply_Info, error) {
+	dest := &bhome_msg.BHAddress{}
+	topic := &bhome_msg.MsgQueryProc{}
+	rep := &bhome_msg.MsgQueryProcReply{}
+	if bhsgo.QueryProcs(dest, topic, rep, h.conf.sendTimeOut) {
+		return rep.ProcList, nil
+	} else {
+		return nil, errors.New("QueryProcs ret flase")
+	}
 }
 
 

--
Gitblit v1.8.0