@@ -80,7 +80,8 @@ static void test_type_notification_callback(
8080 std::lock_guard<std::mutex> lock (app_mutex_);
8181 std::cout << " Type callback received: " << type_name << std::endl;
8282 if (!config.persistence_path .empty () &&
83- !utils::save_type_to_file ((std::filesystem::path (config.persistence_path ) / TYPES_SUBDIR ).string (), type_name,
83+ !utils::save_type_to_file ((std::filesystem::path (config.persistence_path ) / TYPES_SUBDIR ).string (),
84+ type_name,
8485 serialized_type_internal, serialized_type_internal_size))
8586 {
8687 std::cerr << " Failed to save type: " << type_name << std::endl;
@@ -143,7 +144,7 @@ static void test_action_notification_callback(
143144 std::cout << " Action callback received: " << action_name << std::endl;
144145
145146 std::string action_file = (std::filesystem::path (
146- config.persistence_path ) /
147+ config.persistence_path ) /
147148 ACTION_SUBDIR
148149 ).string ();
149150 if (!config.persistence_path .empty ())
@@ -191,28 +192,28 @@ static bool test_action_query_callback(
191192 if (!config.persistence_path .empty ())
192193 {
193194 std::string action_file = (std::filesystem::path (
194- config.persistence_path ) /
195+ config.persistence_path ) /
195196 ACTION_SUBDIR
196197 ).string ();
197198 if (!utils::load_action_from_file (
198- action_file,
199- action_name,
200- action_info.goal .request .type_name ,
201- action_info.goal .reply .type_name ,
202- action_info.cancel .request .type_name ,
203- action_info.cancel .reply .type_name ,
204- action_info.result .request .type_name ,
205- action_info.result .reply .type_name ,
206- action_info.feedback .type_name ,
207- action_info.status .type_name ,
208- action_info.goal .request .serialized_qos ,
209- action_info.goal .reply .serialized_qos ,
210- action_info.cancel .request .serialized_qos ,
211- action_info.cancel .reply .serialized_qos ,
212- action_info.result .request .serialized_qos ,
213- action_info.result .reply .serialized_qos ,
214- action_info.feedback .serialized_qos ,
215- action_info.status .serialized_qos ))
199+ action_file,
200+ action_name,
201+ action_info.goal .request .type_name ,
202+ action_info.goal .reply .type_name ,
203+ action_info.cancel .request .type_name ,
204+ action_info.cancel .reply .type_name ,
205+ action_info.result .request .type_name ,
206+ action_info.result .reply .type_name ,
207+ action_info.feedback .type_name ,
208+ action_info.status .type_name ,
209+ action_info.goal .request .serialized_qos ,
210+ action_info.goal .reply .serialized_qos ,
211+ action_info.cancel .request .serialized_qos ,
212+ action_info.cancel .reply .serialized_qos ,
213+ action_info.result .request .serialized_qos ,
214+ action_info.result .reply .serialized_qos ,
215+ action_info.feedback .serialized_qos ,
216+ action_info.status .serialized_qos ))
216217 {
217218 std::cerr << " Failed to load action: " << action_name << std::endl;
218219 return false ;
@@ -354,7 +355,6 @@ bool wait_for_action_result(
354355 return true ;
355356}
356357
357-
358358bool client_routine (
359359 std::shared_ptr<eprosima::ddsenabler::DDSEnabler> enabler,
360360 const std::string& action_name,
@@ -440,9 +440,9 @@ bool server_specific_logic(
440440 std::string feedback_tmp = feedback_json;
441441 feedback_tmp += " ]}" ;
442442 if (!enabler->send_action_feedback (
443- action_name.c_str (),
444- feedback_tmp.c_str (),
445- request_id))
443+ action_name.c_str (),
444+ feedback_tmp.c_str (),
445+ request_id))
446446 {
447447 std::cerr << " Failed to send action feedback" << std::endl;
448448 return false ;
@@ -457,10 +457,10 @@ bool server_specific_logic(
457457 json += " ]}" ;
458458
459459 if (!enabler->send_action_result (
460- action_name.c_str (),
461- request_id,
462- eprosima::ddsenabler::participants::STATUS_CODE ::STATUS_SUCCEEDED ,
463- json.c_str ()))
460+ action_name.c_str (),
461+ request_id,
462+ eprosima::ddsenabler::participants::STATUS_CODE ::STATUS_SUCCEEDED ,
463+ json.c_str ()))
464464 {
465465 std::cerr << " Failed to send action result" << std::endl;
466466 return false ;
@@ -499,11 +499,11 @@ bool server_routine(
499499 std::this_thread::sleep_for (std::chrono::milliseconds (500 )); // Simulate processing time
500500
501501 // Send Feedback & Result
502- if (!server_specific_logic (
503- enabler,
504- action_name,
505- fibonacci_number,
506- request_id))
502+ if (!server_specific_logic (
503+ enabler,
504+ action_name,
505+ fibonacci_number,
506+ request_id))
507507 {
508508 std::cerr << " Failed to process action: " << action_name << " with request ID: " << request_id << std::endl;
509509 return false ;
@@ -595,8 +595,11 @@ int main(
595595 }
596596 else
597597 {
598- auto goal_path = config.persistence_path .empty () ? std::string () : (std::filesystem::path (config.persistence_path ) / REQUESTS_SUBDIR ).string ();
599- ret = client_routine (enabler, config.action_name , goal_path, config.timeout , config.request_initial_wait , config.cancel_requests );
598+ auto goal_path =
599+ config.persistence_path .empty () ? std::string () : (std::filesystem::path (config.persistence_path ) /
600+ REQUESTS_SUBDIR ).string ();
601+ ret = client_routine (enabler, config.action_name , goal_path, config.timeout , config.request_initial_wait ,
602+ config.cancel_requests );
600603 }
601604
602605 return ret ? EXIT_SUCCESS : EXIT_FAILURE ;
0 commit comments