куча изменений, но зато теперь сохраняются настройки QoS и есть алгоритм сохранения параметров в API
This commit is contained in:
37
dependencies/control_system/client/main.cpp
vendored
37
dependencies/control_system/client/main.cpp
vendored
@@ -6,6 +6,42 @@ std::shared_mutex mtx;
|
||||
TSID sid_counter { 0 };
|
||||
std::map<TSID, std::unique_ptr<system_client>> clients;
|
||||
|
||||
EXTERNC CP_Result CP_SetQoSSettings(TSID sid, const std::string &qos_settings_json, bool is_enable){
|
||||
std::shared_lock lock(mtx);
|
||||
try
|
||||
{
|
||||
if (clients.find(sid) == clients.end())
|
||||
return ERROR;
|
||||
auto resp = clients[sid]->send_set_qos_settings_json(qos_settings_json, is_enable);
|
||||
if (resp == response_type::error)
|
||||
return ERROR;
|
||||
return OK;
|
||||
}
|
||||
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
EXTERNC CP_Result CP_GetQoSSettings(TSID sid, std::string &qos_settings_json, bool &is_enable){
|
||||
std::shared_lock lock(mtx);
|
||||
try
|
||||
{
|
||||
if (clients.find(sid) == clients.end())
|
||||
return ERROR;
|
||||
|
||||
auto resp = clients[sid]->send_get_qos_settings_json(qos_settings_json, is_enable);
|
||||
if (resp == response_type::error)
|
||||
return ERROR;
|
||||
return OK;
|
||||
}
|
||||
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
EXTERNC CP_Result CP_SetBUC_LNB_settings(TSID sid, buc_lnb_settings &settings){
|
||||
std::shared_lock lock(mtx);
|
||||
@@ -25,6 +61,7 @@ EXTERNC CP_Result CP_SetBUC_LNB_settings(TSID sid, buc_lnb_settings &settings){
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
EXTERNC CP_Result CP_GetBUC_LNB_settings(TSID sid, buc_lnb_settings &settings){
|
||||
std::shared_lock lock(mtx);
|
||||
try
|
||||
|
Reference in New Issue
Block a user