куча изменений, но зато теперь сохраняются настройки QoS и есть алгоритм сохранения параметров в API
This commit is contained in:
@@ -433,6 +433,16 @@ void system_client::data_received(const std::vector<uint8_t> & data)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case cmd_type::get_qos_settings_json:
|
||||
{
|
||||
if (cmd.rsp == response_type::ok)
|
||||
{
|
||||
cmd_qos_settings value;
|
||||
iarchive(value);
|
||||
data_from_serv = value;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
|
||||
@@ -705,6 +715,40 @@ response_type system_client::send_get_qos_params(std::string &node, const name_c
|
||||
return result;
|
||||
}
|
||||
|
||||
response_type system_client::send_set_qos_settings_json(const std::string &json_string, bool is_enable){
|
||||
std::scoped_lock lock(cmd_in_progress_mtx);
|
||||
uint32_t curr_id { ++cmd_id };
|
||||
cmd_header cmd_qos_header{curr_id, cmd_type::set_qos_settings_json};
|
||||
cmd_qos_settings qos_settings{json_string, is_enable};
|
||||
|
||||
send_to_socket(cmd_qos_header, qos_settings);
|
||||
|
||||
std::any data_to_serv;
|
||||
|
||||
auto result = wait_for_response(curr_id, cmd_type::set_qos_settings, data_to_serv);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
response_type system_client::send_get_qos_settings_json(std::string &json_string, bool &is_enable){
|
||||
std::scoped_lock lock(cmd_in_progress_mtx);
|
||||
uint32_t curr_id { ++cmd_id };
|
||||
cmd_header cmd_qos_header{curr_id, cmd_type::get_qos_settings_json};
|
||||
cmd_qos_settings qos_settings{json_string, is_enable};
|
||||
|
||||
send_to_socket(cmd_qos_header, qos_settings);
|
||||
|
||||
std::any data_from_serv;
|
||||
|
||||
auto result = wait_for_response(curr_id, cmd_type::get_qos_settings_json, data_from_serv);
|
||||
if (data_from_serv.has_value())
|
||||
{
|
||||
json_string = std::any_cast<cmd_qos_settings>(data_from_serv).json_string;
|
||||
is_enable = std::any_cast<cmd_qos_settings>(data_from_serv).is_enable;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
response_type system_client::send_set_10g_config(const cmd_10g_config & _10g_config, std::string &value)
|
||||
{
|
||||
std::scoped_lock lock(cmd_in_progress_mtx);
|
||||
|
Reference in New Issue
Block a user