@@ -127,13 +127,24 @@ rmw_create_client(
127127 }
128128 client_req = uxr_buffer_create_requester_xml (
129129 & custom_node -> context -> session ,
130- custom_node -> context -> reliable_output , custom_client -> client_id ,
131- custom_node -> participant_id , rmw_uxrce_xml_buffer , UXR_REPLACE );
130+ * custom_node -> context -> entity_creation_output ,
131+ custom_client -> client_id ,
132+ custom_node -> participant_id ,
133+ rmw_uxrce_xml_buffer ,
134+ UXR_REPLACE );
132135#elif defined(MICRO_XRCEDDS_USE_REFS )
133- // TODO(pablogs9): Is possible to instantiate a replier by ref?
134- // client_req = uxr_buffer_create_replier_ref(&custom_node->context->session,
135- // custom_node->context->reliable_output, custom_service->subscriber_id,
136- // custom_node->participant_id, "", UXR_REPLACE);
136+ if (!build_requester_profile (service_name , rmw_uxrce_profile_name , sizeof (rmw_uxrce_profile_name ))) {
137+ RMW_SET_ERROR_MSG ("failed to generate ref request for client creation" );
138+ goto fail ;
139+ }
140+
141+ client_req = uxr_buffer_create_requester_ref (
142+ & custom_node -> context -> session ,
143+ * custom_node -> context -> entity_creation_output ,
144+ custom_client -> client_id ,
145+ custom_node -> participant_id ,
146+ rmw_uxrce_profile_name ,
147+ UXR_REPLACE );
137148#endif
138149
139150 rmw_client -> data = custom_client ;
@@ -144,7 +155,7 @@ rmw_create_client(
144155 & custom_node -> context -> session , 1000 , requests ,
145156 status , 1 ))
146157 {
147- RMW_SET_ERROR_MSG ("Issues creating Micro XRCE-DDS entities" );
158+ RMW_SET_ERROR_MSG ("Issues creating Requester Micro XRCE-DDS entities" );
148159 put_memory (& client_memory , & custom_client -> mem );
149160 goto fail ;
150161 }
@@ -162,8 +173,10 @@ rmw_create_client(
162173
163174 custom_client -> request_id = uxr_buffer_request_data (
164175 & custom_node -> context -> session ,
165- custom_node -> context -> reliable_output , custom_client -> client_id ,
166- custom_client -> stream_id , & delivery_control );
176+ * custom_node -> context -> entity_creation_output ,
177+ custom_client -> client_id ,
178+ custom_client -> stream_id ,
179+ & delivery_control );
167180 }
168181 return rmw_client ;
169182
@@ -203,7 +216,8 @@ rmw_destroy_client(
203216 rmw_uxrce_client_t * custom_client = (rmw_uxrce_client_t * )client -> data ;
204217 uint16_t delete_client =
205218 uxr_buffer_delete_entity (
206- & custom_node -> context -> session , custom_node -> context -> reliable_output ,
219+ & custom_node -> context -> session ,
220+ * custom_node -> context -> entity_creation_output ,
207221 custom_client -> client_id );
208222
209223 uint16_t requests [] = {delete_client };
@@ -212,7 +226,7 @@ rmw_destroy_client(
212226 & custom_node -> context -> session , 1000 , requests , status ,
213227 sizeof (status )))
214228 {
215- RMW_SET_ERROR_MSG ("unable to remove client from the server" );
229+ RMW_SET_ERROR_MSG ("Unable to remove client from the server" );
216230 result_ret = RMW_RET_ERROR ;
217231 } else {
218232 rmw_uxrce_fini_client_memory (client );
0 commit comments