From 34cd75f77d0ca94dbdba4e6cc9451fe4d33e78b3 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期三, 19 五月 2021 19:14:13 +0800
Subject: [PATCH] add api BHQueryProcs.

---
 api/bhsgo/bhome_node_test.go |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/api/bhsgo/bhome_node_test.go b/api/bhsgo/bhome_node_test.go
index 756b752..cd4bfb9 100644
--- a/api/bhsgo/bhome_node_test.go
+++ b/api/bhsgo/bhome_node_test.go
@@ -26,6 +26,7 @@
 	proc_id := "test_proc"
 	proc := bh.ProcInfo{}
 	proc.ProcId = []byte(proc_id)
+	fmt.Println("proc id: ", proc.ProcId)
 	reply := bh.MsgCommonReply{}
 	defer Cleanup()
 
@@ -69,6 +70,7 @@
 	} else {
 		fmt.Println("reg topics failed")
 	}
+
 	req := bh.MsgRequestTopic{}
 	time.Sleep(time.Second * 1)
 	req.Topic = []byte("topic0")
@@ -81,7 +83,14 @@
 	pid := ""
 	rr := bh.MsgRequestTopicReply{}
 	dest := bh.BHAddress{}
-	for i := 0; i < 100; i++ {
+
+	queryProc := bh.MsgQueryProc{}
+	queryReply := bh.MsgQueryProcReply{}
+
+	QueryProcs(&dest, &queryProc, &queryReply, 3000)
+	fmt.Println("query result:", string(queryReply.ProcList[0].Proc.ProcId))
+
+	for i := 0; i < 10; i++ {
 		if Request(&dest, &req, &pid, &rr, 3000) {
 			fmt.Println("server:" + pid + ", reply:" + string(rr.Data))
 		} else {

--
Gitblit v1.8.0