From a1d28d0233c63889867fb6d955ec7706464d68c7 Mon Sep 17 00:00:00 2001 From: "paul.quillen" Date: Wed, 30 Oct 2024 15:32:00 -0500 Subject: [PATCH] AP_DDS: Changed AP_DDS_Client.cpp to use the set_and_save_by_name_ifchanged method to set parameter. --- libraries/AP_DDS/AP_DDS_Client.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/libraries/AP_DDS/AP_DDS_Client.cpp b/libraries/AP_DDS/AP_DDS_Client.cpp index 77291d4d5afdb..f1fe5a824adaf 100644 --- a/libraries/AP_DDS/AP_DDS_Client.cpp +++ b/libraries/AP_DDS/AP_DDS_Client.cpp @@ -777,8 +777,6 @@ void AP_DDS_Client::on_request(uxrSession* uxr_session, uxrObjectId object_id, u continue; } - float old_value = vp->cast_to_float(var_type); - // Add existing parameter checks used in GCS_Param.cpp if (parameter_flags & AP_PARAM_FLAG_INTERNAL_USE_ONLY) { // The user can set BRD_OPTIONS to enable set of internal @@ -794,14 +792,8 @@ void AP_DDS_Client::on_request(uxrSession* uxr_session, uxrObjectId object_id, u continue; } - // set the value - vp->set_float(param_value, var_type); - - // Force the save if the value is not equal to the old one - bool force_save = !is_equal(param_value, old_value); - - // save the change - vp->save(force_save); + // Set and save the value if it changed + bool force_save = vp->set_and_save_by_name_ifchanged(param_key, param_value); if (force_save && (parameter_flags & AP_PARAM_FLAG_ENABLE)) { AP_Param::invalidate_count();