From ba9e213d3f01555d823aaf453798a148dade45a4 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期二, 13 十二月 2022 09:56:18 +0800
Subject: [PATCH] 添加注释

---
 cbhomeclient.h |   43 +++++++++++++++++++++++++++++++++++++++----
 1 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/cbhomeclient.h b/cbhomeclient.h
index 3056b04..fba5c9e 100644
--- a/cbhomeclient.h
+++ b/cbhomeclient.h
@@ -10,17 +10,52 @@
 extern "C"{
 #endif
 
+/*
+    閰嶅悎 message.h[cpp] 浣跨敤
+*/
+/*
+    鍒濆鍖� bus client锛宻rvid 琛ㄦ槑褰撳墠鏈哄櫒鐨� srvid 鐢ㄤ簬杩滅▼閫氫俊锛岀洰鍓嶆病鐢�
+    rinfo 鏄敞鍐岃繘绋嬬殑娑堟伅锛屽崟杩涚▼澶氭璋冪敤锛岄渶瑕佷娇鐢ㄤ笉鍚岀殑rinfo
+*/
 void* bus_client_init(const char* srvid, const size_t sidsize, const creg* rinfo);
+/*
+    閲婃斁 bus client
+*/
 void bus_client_free(void* handle);
 
+/*
+    鑾峰彇璁㈤槄鐨勬秷鎭紝璁㈤槄娑堟伅閫氳繃绾跨▼涓嶅仠璇诲彇锛屾澶勪粠缂撳瓨涓鍙�
+    鍙�氳繃 message.h 瀵瑰簲鐨� get_submsg_db get_submsg_proclist 鑾峰彇瀵瑰簲鐨勬秷鎭�
+*/
 struct csubmsg* bus_client_get_submsg(void* handle);
+/*
+    鍙戝竷娑堟伅锛宒ata 鏄� MsgPublish protobuffer搴忓垪鍖栧悗鐨勬暟鎹�
+*/
+int bus_client_pubmsg(void* handle, const char* data, const size_t size);
+/*
+    鍙戝竷娑堟伅锛宼opic 鏄彂甯冧富棰橈紝 data 鏄彂甯冪殑娑堟伅浣�
+*/
+int bus_client_publish(void* handle, const char* topic, const size_t topicl, const char* data, const size_t size);
 
+/*
+    鑾峰彇 request 娑堟伅锛岄�氳繃绾跨▼璇诲彇锛屾澶勪粠缂撳瓨涓鍙�
+    鍙�氳繃 message.h 鐨� get_reqmsg_stackerr get_reqmsg_stack 鑾峰彇瀵瑰簲鐨勬秷鎭�
+    src 鏄摢涓�涓繘绋嬭姹傜殑鏍囪瘑绗�
+    鍙互鍝嶅簲澶氫釜request鍙戦�佺殑娑堟伅锛屽悓鏃堕渶瑕佹弧瓒冲紓姝ュ搷搴旓紝浣跨敤 src 杩涜鍖哄垎
+    绫讳技涓巘cp/ip鐨剆ocket锛屾爣璇嗕竴涓繛鎺�
+*/
 struct creqmsg* bus_client_get_reqmsg(void* handle, void** src);
-int bus_client_request(void* handle, struct creqmsg* msg, struct crepmsg** repmsg);
+/*
+    鍝嶅簲娑堟伅鍥炲锛宻rc鏄繛鎺ユ爣璇嗙锛宮sg鏄渶瑕佸洖澶嶇殑娑堟伅
+    閫氳繃 message.h 鐨� make_reply_msg 鍒涘缓
+*/
 int bus_client_reply_msg(void* handle, void* src, const struct crepmsg* msg);
-
-// test
-int bus_client_pubmsg(void* handle, void* data, const size_t size);
+/*
+    鍚屾鐨剅equest璇锋眰锛屽彂閫� creqmsg 鑾峰彇 crepmsg 鍥炲
+    閫氳繃 message.h 鐨� make_req_msg 鍒涘缓 request 娑堟伅
+    鑾峰彇鐨� crepmsg 鍥炲娑堟伅锛岄渶瑕佷娇鐢� free_reply_msg 閲婃斁
+*/
+int bus_client_request(void* handle, struct creqmsg* msg, struct crepmsg** repmsg);
 
 #ifdef __cplusplus
 }

--
Gitblit v1.8.0