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:
@@ -25,16 +25,16 @@ struct REGInfo
|
||||
}
|
||||
};
|
||||
|
||||
//struct TopicInfo
|
||||
//{
|
||||
// std::string name;
|
||||
// std::string topic;
|
||||
// int deviceType;
|
||||
// TopicInfo() {};
|
||||
// TopicInfo(std::string name, std::string topic, int deviceType)
|
||||
// :name(name), topic(topic), deviceType(deviceType)
|
||||
// {};
|
||||
//};
|
||||
struct TopicInfo
|
||||
{
|
||||
std::string name;
|
||||
int deviceType {0};
|
||||
int polling {0}; // 召测
|
||||
TopicInfo() {};
|
||||
TopicInfo(std::string name, int deviceType, int polling=0)
|
||||
:name(name), deviceType(deviceType), polling(polling)
|
||||
{};
|
||||
};
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -47,8 +47,7 @@ public:
|
||||
void destory();
|
||||
|
||||
void subscribe();
|
||||
//int publish();
|
||||
|
||||
int publish(std::string topic, std::string text);
|
||||
int polling();
|
||||
|
||||
void onConnectionLost(char* cause);
|
||||
@@ -61,6 +60,7 @@ public:
|
||||
void parseEMS_YX(std::shared_ptr<Station> station, njson& json, std::map<std::string, REGInfo>& mapRegInfo);
|
||||
|
||||
public:
|
||||
// MQTT clientId (使用station 的 code)
|
||||
std::string clientId;
|
||||
MQTTAsync client = nullptr;
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
bool isConnected {false};
|
||||
bool isSubscribed {false};
|
||||
|
||||
std::map<std::string, int> mapTopicInfo;
|
||||
std::map<std::string, TopicInfo> mapTopicInfo;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user