fix: исправил предупреждения компилятора в релизной версии вебки
This commit is contained in:
@@ -569,7 +569,7 @@ void api_driver::obj::TerminalRxTxSettings::storeMainSettings(proxy::CpProxy &cp
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(MODEM_IS_SCPC) || defined(MODEM_IS_SHPS)
|
||||||
struct ModcodDef_t {const char* modulation; const char* speed;};
|
struct ModcodDef_t {const char* modulation; const char* speed;};
|
||||||
const static ModcodDef_t ModcodDefs[] = {
|
const static ModcodDef_t ModcodDefs[] = {
|
||||||
{.modulation = "dummy", .speed = "0"},
|
{.modulation = "dummy", .speed = "0"},
|
||||||
@@ -637,7 +637,7 @@ static uint32_t buildModcodFromJson(const nlohmann::json& data, uint32_t modcod,
|
|||||||
}
|
}
|
||||||
return (modcod << 2)| (isNormalFrame ? 0 : 2) | (isPilots ? 1 : 0);
|
return (modcod << 2)| (isNormalFrame ? 0 : 2) | (isPilots ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void api_driver::obj::TerminalRxTxSettings::updateMainSettings(const nlohmann::json &data) {
|
void api_driver::obj::TerminalRxTxSettings::updateMainSettings(const nlohmann::json &data) {
|
||||||
// для модулятора
|
// для модулятора
|
||||||
@@ -1011,8 +1011,8 @@ std::string api_driver::obj::TerminalManagerLogs::loadPreview() {
|
|||||||
|
|
||||||
// Читаем файл с конца для эффективности
|
// Читаем файл с конца для эффективности
|
||||||
file.seekg(0, std::ios::end);
|
file.seekg(0, std::ios::end);
|
||||||
size_t size = file.tellg();
|
auto size = file.tellg();
|
||||||
std::string content(size, '\0');
|
std::string content(static_cast<size_t>(size), '\0');
|
||||||
file.seekg(0);
|
file.seekg(0);
|
||||||
file.read(&content[0], size);
|
file.read(&content[0], size);
|
||||||
|
|
||||||
@@ -1041,7 +1041,7 @@ std::string api_driver::obj::TerminalManagerLogs::loadPreview() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string api_driver::obj::TerminalManagerLogs::loadPreviewWithFilter(const std::string& logLevel) {
|
std::string api_driver::obj::TerminalManagerLogs::loadPreviewWithFilter(const std::string& logLevel) {
|
||||||
return "Logs filtering not supported yet...";
|
return "Logs level " + logLevel + " filtering not supported yet...";
|
||||||
}
|
}
|
||||||
|
|
||||||
void api_driver::obj::TerminalManagerLogs::loadFullLog(std::vector<char>& destData) {
|
void api_driver::obj::TerminalManagerLogs::loadFullLog(std::vector<char>& destData) {
|
||||||
@@ -1052,11 +1052,11 @@ void api_driver::obj::TerminalManagerLogs::loadFullLog(std::vector<char>& destDa
|
|||||||
std::ifstream stream(logsFileDir + file, std::ios::binary | std::ios::ate);
|
std::ifstream stream(logsFileDir + file, std::ios::binary | std::ios::ate);
|
||||||
if (!stream) continue;
|
if (!stream) continue;
|
||||||
|
|
||||||
std::streamsize size = stream.tellg();
|
auto size = stream.tellg();
|
||||||
stream.seekg(0, std::ios::beg);
|
stream.seekg(0, std::ios::beg);
|
||||||
|
|
||||||
size_t currentSize = destData.size();
|
size_t currentSize = destData.size();
|
||||||
destData.resize(currentSize + size);
|
destData.resize(currentSize + static_cast<size_t>(size));
|
||||||
stream.read(destData.data() + currentSize, size);
|
stream.read(destData.data() + currentSize, size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -81,7 +81,7 @@ class ServerResources {
|
|||||||
std::string cmd(UPGRADE_COMMAND);
|
std::string cmd(UPGRADE_COMMAND);
|
||||||
cmd += " ";
|
cmd += " ";
|
||||||
cmd += FIRMWARE_LOCATION;
|
cmd += FIRMWARE_LOCATION;
|
||||||
system(cmd.c_str());
|
std::ignore = system(cmd.c_str());
|
||||||
cp.setDmaDebug("save_config", "");
|
cp.setDmaDebug("save_config", "");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -479,7 +479,7 @@ public:
|
|||||||
const std::string result = R"({"status":"ok"})";
|
const std::string result = R"({"status":"ok"})";
|
||||||
rep.content.insert(rep.content.end(), result.c_str(), result.c_str() + result.size());
|
rep.content.insert(rep.content.end(), result.c_str(), result.c_str() + result.size());
|
||||||
this->upgradeOrRebootRunning = true;
|
this->upgradeOrRebootRunning = true;
|
||||||
system(REBOOT_COMMAND);
|
std::ignore = system(REBOOT_COMMAND);
|
||||||
}));
|
}));
|
||||||
s.resources.emplace_back(std::make_unique<http::auth::AuthRequiredResource>("/api/resetSettings", this->auth, http::auth::User::EDIT_SETTINGS, [this](const auto& req, auto& rep) {
|
s.resources.emplace_back(std::make_unique<http::auth::AuthRequiredResource>("/api/resetSettings", this->auth, http::auth::User::EDIT_SETTINGS, [this](const auto& req, auto& rep) {
|
||||||
if (req.method != "POST") {
|
if (req.method != "POST") {
|
||||||
@@ -491,7 +491,7 @@ public:
|
|||||||
const std::string result = R"({"status":"ok"})";
|
const std::string result = R"({"status":"ok"})";
|
||||||
rep.content.insert(rep.content.end(), result.c_str(), result.c_str() + result.size());
|
rep.content.insert(rep.content.end(), result.c_str(), result.c_str() + result.size());
|
||||||
api->resetDefaultSettings();
|
api->resetDefaultSettings();
|
||||||
system(REBOOT_COMMAND);
|
std::ignore = system(REBOOT_COMMAND);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
s.resources.emplace_back(std::make_unique<http::auth::AuthRequiredResource>("/api/firmwareUpdate", this->auth, http::auth::User::UPDATE_FIRMWARE, [this](const auto& req, auto& rep) {
|
s.resources.emplace_back(std::make_unique<http::auth::AuthRequiredResource>("/api/firmwareUpdate", this->auth, http::auth::User::UPDATE_FIRMWARE, [this](const auto& req, auto& rep) {
|
||||||
|
Reference in New Issue
Block a user