mirror of
https://github.com/MrUnknownDE/OpenIris-ESPIDF.git
synced 2026-04-11 10:43:45 +02:00
Implement get config command and api endpoint for testing purposes
This commit is contained in:
@@ -467,6 +467,26 @@ std::string ProjectConfig::WiFiTxPower_t::toRepresentation()
|
||||
return json;
|
||||
}
|
||||
|
||||
std::string ProjectConfig::TrackerConfig_t::toRepresentation()
|
||||
{
|
||||
std::string WifiConfigRepresentation = "";
|
||||
|
||||
for (auto &network : this->networks)
|
||||
{
|
||||
WifiConfigRepresentation += Helpers::format_string(", %s", network.toRepresentation());
|
||||
}
|
||||
|
||||
std::string json = Helpers::format_string(
|
||||
"%s, %s, %s, %s, %s, %s",
|
||||
this->device.toRepresentation().c_str(),
|
||||
this->mdns.toRepresentation().c_str(),
|
||||
this->camera.toRepresentation().c_str(),
|
||||
WifiConfigRepresentation.c_str(),
|
||||
this->mdns.toRepresentation().c_str(),
|
||||
this->txpower.toRepresentation().c_str());
|
||||
return json;
|
||||
}
|
||||
|
||||
//**********************************************************************************************************************
|
||||
//*
|
||||
//! Get Methods
|
||||
@@ -497,3 +517,7 @@ ProjectConfig::WiFiTxPower_t &ProjectConfig::getWiFiTxPowerConfig()
|
||||
{
|
||||
return this->config.txpower;
|
||||
}
|
||||
ProjectConfig::TrackerConfig_t &ProjectConfig::getTrackerConfig()
|
||||
{
|
||||
return this->config;
|
||||
}
|
||||
@@ -99,6 +99,7 @@ public:
|
||||
AP_WiFiConfig_t ap_network;
|
||||
MDNSConfig_t mdns;
|
||||
WiFiTxPower_t txpower;
|
||||
std::string toRepresentation();
|
||||
};
|
||||
|
||||
DeviceConfig_t &getDeviceConfig();
|
||||
@@ -107,6 +108,7 @@ public:
|
||||
AP_WiFiConfig_t &getAPWifiConfig();
|
||||
MDNSConfig_t &getMDNSConfig();
|
||||
WiFiTxPower_t &getWiFiTxPowerConfig();
|
||||
TrackerConfig_t &getTrackerConfig();
|
||||
|
||||
void setDeviceConfig(const std::string &OTALogin,
|
||||
const std::string &OTAPassword,
|
||||
|
||||
Reference in New Issue
Block a user