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