исправления для TDMA

This commit is contained in:
Vladislav Ostapov 2025-06-01 15:59:42 +03:00
parent c2dd4b13e8
commit 50f82483fd
6 changed files with 20 additions and 17 deletions

View File

@ -92,7 +92,7 @@ void api_driver::TerminalApiDaemon::run() {
CpUpdatebleObject uo; CpUpdatebleObject uo;
std::string updaterName; std::string updaterName;
} updaters[] = { } updaters[] = {
#ifdef API_OBJECT_NETWORK_SETTINGS_ENABLE #ifdef API_OBJECT_DEBUG_METRICS_ENABLE
// обновление логов // обновление логов
{.uo = CpUpdatebleObject([this]() { {.uo = CpUpdatebleObject([this]() {
this->statsLogs.updateCallback(cp); this->statsLogs.updateCallback(cp);

View File

@ -51,6 +51,10 @@ namespace api_driver::proxy {
void getDebugMetrics(debug_metrics& dest); void getDebugMetrics(debug_metrics& dest);
#endif #endif
#ifdef MODEM_IS_TDMA
void getUpdateStatus(progress_msg& dest);
#endif
~CpProxy(); ~CpProxy();
}; };
} }

View File

@ -11,9 +11,6 @@
typedef boost::property_tree::ptree::path_type json_path; typedef boost::property_tree::ptree::path_type json_path;
static constexpr const char* DEFAULT_QOS_CLASSES = R"({"rt1":[],"rt2":[],"rt3":[],"cd":[]})";
// пороговое значение сна
double translateCoordinates(uint8_t deg, uint8_t min) { double translateCoordinates(uint8_t deg, uint8_t min) {
return static_cast<double>(deg) + static_cast<double>(min) / 60; return static_cast<double>(deg) + static_cast<double>(min) / 60;
} }
@ -345,8 +342,8 @@ void api_driver::obj::TerminalState::updateCallback(proxy::CpProxy& cp) {
fCincChannelDelay = cinc.delay_dpdi; fCincChannelDelay = cinc.delay_dpdi;
#endif #endif
#ifdef MODEM_IS_TDMA #ifdef MODEM_IS_TDMA
fStatTxCenterFreq = modSet.central_freq_in_kGz; fTxCenterFreq = modSet.central_freq_in_kGz;
fStatTxSymSpeed = static_cast<double>(modSet.baudrate) / 1000.0; fTxSymSpeed = static_cast<double>(modSet.baudrate) / 1000.0;
#endif #endif
} }
@ -433,10 +430,10 @@ void api_driver::obj::TerminalDeviceState::updateCallback(proxy::CpProxy &cp) {
#ifdef MODEM_IS_TDMA #ifdef MODEM_IS_TDMA
{ {
progress_msg ds{}; progress_msg ds{};
logCpApiError("api_driver::TerminalApiDaemon::updateState()->CP_GetUpdateStatus()", CP_GetUpdateStatus(sid, ds)); cp.getUpdateStatus(ds);
fOtaStatus = ds.status; fUpgradeStatus = ds.status;
fOtaPercent = ds.dwl_percent; fUpgradePercent = ds.dwl_percent;
fOtaImage = ds.cur_image; fUpgradeImage = ds.cur_image;
} }
#endif #endif

View File

@ -180,8 +180,8 @@ namespace api_driver::obj {
float fCincChannelDelay; float fCincChannelDelay;
#endif #endif
#ifdef MODEM_IS_TDMA #ifdef MODEM_IS_TDMA
TODO fTxCenterFreq; double fTxCenterFreq;
TODO fTxSymSpeed; double fTxSymSpeed;
#endif #endif
TerminalState(); TerminalState();

View File

@ -83,19 +83,19 @@ class ServerResources {
cmd += " "; cmd += " ";
cmd += FIRMWARE_LOCATION; cmd += FIRMWARE_LOCATION;
system(cmd.c_str()); system(cmd.c_str());
cp.setDmaDebug("begin_save_config", ""); cp.setDmaDebug("save_config", "");
}); });
} }
#ifdef MODEM_IS_TDMA #ifdef MODEM_IS_TDMA
void doTerminalUpgradeOta() const { void doTerminalUpgradeOta() const {
api->executeInApi([&](proxy::CpProxy&) { api->executeInApi([&](auto& cp) {
CP_SetDmaDebug(sid, "begin_save_config", ""); cp.setDmaDebug("begin_save_config", "");
std::string cmd(UPGRADE_COMMAND); std::string cmd(UPGRADE_COMMAND);
cmd += " "; cmd += " ";
cmd += api->getOtaFileLocation(); cmd += api->getOtaFileLocation();
system(cmd.c_str()); system(cmd.c_str());
CP_SetDmaDebug(sid, "save_config", ""); cp.setDmaDebug("save_config", "");
}); });
} }
#endif #endif

View File

@ -197,7 +197,9 @@ void api_driver::ApiDriver::executeInApi(const std::function<void(proxy::CpProxy
#ifdef MODEM_IS_TDMA #ifdef MODEM_IS_TDMA
std::string api_driver::ApiDriver::getOtaFileLocation() const { std::string api_driver::ApiDriver::getOtaFileLocation() const {
return daemon->getState().otaImage; obj::TerminalDeviceState ds;
daemon->getDeviceState(ds);
return ds.fUpgradeImage;
} }
#endif #endif