mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-28 03:09:24 +08:00
修改MQTT通讯数据解析问题
This commit is contained in:
@@ -1,23 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
struct DatabaseOption
|
||||
{
|
||||
std::string host;
|
||||
int port;
|
||||
std::string user;
|
||||
std::string passwd;
|
||||
std::string dbname;
|
||||
};
|
||||
|
||||
struct AppOption
|
||||
{
|
||||
DatabaseOption database;
|
||||
int debug {0};
|
||||
std::string webSrvUrl;
|
||||
std::string lunchDate;
|
||||
|
||||
struct {
|
||||
bool useToken {true};
|
||||
std::string host;
|
||||
int port;
|
||||
std::string user;
|
||||
std::string passwd;
|
||||
std::string dbname;
|
||||
} database;
|
||||
|
||||
struct {
|
||||
int useToken {1};
|
||||
int port {0};
|
||||
int encryption {1};
|
||||
std::string encryptKey;
|
||||
} http;
|
||||
|
||||
struct {
|
||||
@@ -26,8 +30,20 @@ struct AppOption
|
||||
std::string password;
|
||||
} mqtt;
|
||||
|
||||
std::string webSrvUrl;
|
||||
std::string lunchDate;
|
||||
struct {
|
||||
float latitude {0};
|
||||
float longitude {0};
|
||||
float altitude {0};
|
||||
} view;
|
||||
|
||||
struct VideoInfo {
|
||||
std::string host;
|
||||
int port;
|
||||
std::string user;
|
||||
std::string passwd;
|
||||
};
|
||||
|
||||
std::map<std::string, VideoInfo> mapVideo;
|
||||
|
||||
};
|
||||
|
||||
@@ -36,6 +52,7 @@ class Config
|
||||
public:
|
||||
static bool init(std::string filename);
|
||||
|
||||
static AppOption::VideoInfo* getVideoInfo(std::string name);
|
||||
|
||||
static AppOption option;
|
||||
};
|
||||
Reference in New Issue
Block a user