修改MQTT通讯数据解析问题

This commit is contained in:
lixiaoyuan
2025-09-19 18:54:36 +08:00
parent 2ba4ab2781
commit 996cbac88c
27 changed files with 2743 additions and 1415 deletions

View File

@@ -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;
};