From dd5a4aa12c5bd913be552b415a0268e9ef9ea9fd Mon Sep 17 00:00:00 2001 From: AIOS User <basic@aios.aios.baisc> Date: 星期二, 31 八月 2021 14:01:16 +0800 Subject: [PATCH] build *.proto to cpp --- src/bh_api.cpp | 23 ++++++++++------------- 1 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/bh_api.cpp b/src/bh_api.cpp index 76e78d7..8770bdf 100644 --- a/src/bh_api.cpp +++ b/src/bh_api.cpp @@ -7,11 +7,8 @@ #include "bh_api.h" #include <pthread.h> #include <getopt.h> -#include "bhome_msg_api.pb.h" -#include "bhome_msg.pb.h" -#include "error_msg.pb.h" -#include "proto/bhome_msg.pb.h" -#include "proto/bhome_msg_api.pb.h" +#include "../proto/source/bhome_msg.pb.h" +#include "../proto/source/bhome_msg_api.pb.h" static Logger *logger = LoggerFactory::getLogger(); @@ -906,7 +903,7 @@ } #if defined(PRO_DE_SERIALIZE) -int BHPublish(const char *msgpub, const char msgpub_len, const int timeout_ms) +int BHPublish(const char *msgpub, const int msgpub_len, const int timeout_ms) #else int BHPublish(const char *topic, const char *content, const int timeout_ms) #endif @@ -1275,6 +1272,12 @@ int sec, nsec; char topics_buf[MAX_STR_LEN] = { 0x00 }; + struct _RequestReply + { + std::string proc_id; + std::string data; + }rr; + #if defined(PRO_DE_SERIALIZE) struct _BHAddress { @@ -1289,7 +1292,7 @@ const char *topic; const char *data; }_input1; - + ::bhome_msg::BHAddress input0; ::bhome_msg::MsgRequestTopic input1; if (!input0.ParseFromArray(remote, remote_len) || !input1.ParseFromArray(request, request_len)) { @@ -1389,12 +1392,6 @@ memset(errString, 0x00, sizeof(errString)); strncpy(errString, bus_strerror(rv), sizeof(errString)); - - struct _RequestReply - { - std::string proc_id; - std::string data; - }rr; if (rv == 0) { memset(topics_buf, 0x00, sizeof(topics_buf)); -- Gitblit v1.8.0