1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- #ifndef GRPCPC_H
- #define GRPCPC_H
- #include <QThread>
- #include <yaml-cpp/yaml.h>
- #include <QDateTime>
- #include <iostream>
- #include <vector>
- #include <memory>
- #include <QMutex>
- #include <thread>
- #include "modulecomm.h"
- #include "cloud.pb.h"
- #include <iostream>
- #include <memory>
- #include <string>
- #include <grpcpp/grpcpp.h>
- #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<char> 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<iv::msgunit> mvectormsgunit;
- std::vector<iv::msgunit> 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
|