#ifndef GRPCPC_H #define GRPCPC_H #include #include #include #include #include #include #include #include #include "modulecomm.h" #include "cloud.pb.h" #include #include #include #include #include "uploadthreadmsg.grpc.pb.h" using grpc::Channel; using grpc::ClientContext; using grpc::Status; namespace iv { struct msgunit { char mstrmsgname[256]; int mnBufferSize = 10000; int mnBufferCount = 1; void * mpa; std::shared_ptr mpstrmsgdata; int mndatasize = 0; bool mbRefresh = false; bool mbImportant = false; int mnkeeptime = 100; }; } class grpcpc : public QThread { public: grpcpc(std::string stryamlpath); private: void run(); private: std::string gstrserverip = "140.143.237.38"; std::string gstrserverport = "9000"; std::string gstruploadinterval = "100"; void * gpa; QMutex gMutexMsg; std::vector mvectormsgunit; std::vector mvectorctrlmsgunit; std::string gstrVIN = "AAAAAAAAAAAAAAAAA"; std::string gstrqueryMD5 = "5d41402abc4b2a76b9719d911017c592"; std::string gstrctrlMD5 = "5d41402abc4b2a76b9719d911017c592"; int gindex = 0; private: void dec_yaml(const char * stryamlpath); void sharequerymsg(iv::cloud::cloudmsg * pxmsg); public: void UpdateData(const char * strdata,const unsigned int nSize,const char * strmemname); std::string GetVIN(); }; #endif // GRPCPC_H