mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
调试修改HTTP接口
This commit is contained in:
@@ -5,11 +5,29 @@
|
||||
#include <functional>
|
||||
#include "MQTTAsync.h"
|
||||
|
||||
struct REGInfo
|
||||
{
|
||||
std::string key;
|
||||
std::string datatype;
|
||||
int bytes {0};
|
||||
std::string remark;
|
||||
|
||||
REGInfo() {}
|
||||
REGInfo(std::string key, std::string datatype, std::string remark)
|
||||
: key(key), datatype(datatype), remark(remark)
|
||||
{
|
||||
if (datatype == "uint16" || datatype == "int16") { bytes = 1; }
|
||||
else if (datatype == "uint32" || datatype == "int32") { bytes = 2; }
|
||||
}
|
||||
};
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MqttClient
|
||||
{
|
||||
public:
|
||||
static void loadDataStruct(std::string filename);
|
||||
|
||||
int init(string addr, string clientId, string username, string password);
|
||||
void destory();
|
||||
|
||||
@@ -23,8 +41,25 @@ public:
|
||||
void onConnectSuccess(MQTTAsync_successData* resp);
|
||||
void onConnectFaiure(MQTTAsync_failureData* resp);
|
||||
|
||||
void parseEMS_YX(std::string& text);
|
||||
void parseEMS_YC(std::string& text);
|
||||
void parsePCU_YX(std::string& text);
|
||||
void parsePCU_YC(std::string& text);
|
||||
void parsePCS_YX(std::string& text);
|
||||
void parsePCS_YC(std::string& text);
|
||||
void parseBMS_YC(std::string& text);
|
||||
void parseBCU_YX(std::string& text);
|
||||
void parseBCU_YC(std::string& text);
|
||||
void parseMEM_YC(std::string& text);
|
||||
void parseTH_YC(std::string& text);
|
||||
void parseFire40_YX(std::string& text);
|
||||
void parseCooling_YX(std::string& text);
|
||||
void parseCooling_YC(std::string& text);
|
||||
void parseCharger_YC(std::string& text);
|
||||
void parseGateway_YX(std::string& text);
|
||||
void parseGateway_YC(std::string& text);
|
||||
void parseGateway_YT(std::string& text);
|
||||
void parseTQ(std::string& text);
|
||||
|
||||
public:
|
||||
std::string clientId;
|
||||
|
||||
Reference in New Issue
Block a user