lichao
2021-05-19 34cd75f77d0ca94dbdba4e6cc9451fe4d33e78b3
api/bhsgo/bhome_node.go
@@ -75,6 +75,20 @@
}
func QueryProcs(dest_addr *bh.BHAddress, topic *bh.MsgQueryProc, reply *bh.MsgQueryProcReply, timeout_ms int) bool {
   dest, _ := dest_addr.Marshal()
   data, _ := topic.Marshal()
   creply := unsafe.Pointer(nil)
   creply_len := C.int(0)
   defer C.BHFree(creply, creply_len)
   r := C.BHQueryProcs(getPtr(&dest), C.int(len(dest)), getPtr(&data), C.int(len(data)), &creply, &creply_len, C.int(timeout_ms)) > 0
   if r {
      reply.Unmarshal(C.GoBytes(creply, creply_len))
   }
   return r
}
func Publish(pub *bh.MsgPublish, timeout_ms int) bool {
   data, _ := pub.Marshal()
   return C.BHPublish(getPtr(&data), C.int(len(data)), C.int(timeout_ms)) > 0