Skip to content

Commit ab0be1d

Browse files
authored
Add event callbacks & get actual qos (#228)
* Add event callbacks & get actual qos Signed-off-by: Pablo Garrido <pablogs9@gmail.com> * Update Signed-off-by: Pablo Garrido <pablogs9@gmail.com> * Includes Signed-off-by: Pablo Garrido <pablogs9@gmail.com> * Uncrus Signed-off-by: Pablo Garrido <pablogs9@gmail.com>
1 parent 1166b3a commit ab0be1d

6 files changed

Lines changed: 127 additions & 2 deletions

File tree

rmw_microxrcedds_c/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ set(SRCS
189189
src/types.c
190190
src/utils.c
191191
src/callbacks.c
192+
src/rmw_event_callbacks.c
192193
src/rmw_uxrce_transports.c
193194
src/rmw_microros/continous_serialization.c
194195
src/rmw_microros/init_options.c

rmw_microxrcedds_c/src/rmw_client.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,3 +237,29 @@ rmw_destroy_client(
237237

238238
return result_ret;
239239
}
240+
241+
rmw_ret_t
242+
rmw_client_request_publisher_get_actual_qos(
243+
const rmw_client_t * client,
244+
rmw_qos_profile_t * qos)
245+
{
246+
(void) qos;
247+
248+
rmw_uxrce_client_t * custom_client = (rmw_uxrce_client_t *)client->data;
249+
qos = &custom_client->qos;
250+
251+
return RMW_RET_OK;
252+
}
253+
254+
rmw_ret_t
255+
rmw_client_response_subscription_get_actual_qos(
256+
const rmw_client_t * client,
257+
rmw_qos_profile_t * qos)
258+
{
259+
(void) qos;
260+
261+
rmw_uxrce_client_t * custom_client = (rmw_uxrce_client_t *)client->data;
262+
qos = &custom_client->qos;
263+
264+
return RMW_RET_OK;
265+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#include <rmw/rmw.h>
16+
#include "./rmw_microros_internal/error_handling_internal.h"
17+
18+
rmw_ret_t
19+
rmw_subscription_set_on_new_message_callback(
20+
rmw_subscription_t * subscription,
21+
rmw_event_callback_t callback,
22+
const void * user_data)
23+
{
24+
(void) subscription;
25+
(void) callback;
26+
(void) user_data;
27+
28+
RMW_UROS_TRACE_MESSAGE("function not implemented");
29+
return RMW_RET_UNSUPPORTED;
30+
}
31+
32+
rmw_ret_t
33+
rmw_service_set_on_new_request_callback(
34+
rmw_service_t * service,
35+
rmw_event_callback_t callback,
36+
const void * user_data)
37+
{
38+
(void) service;
39+
(void) callback;
40+
(void) user_data;
41+
42+
RMW_UROS_TRACE_MESSAGE("function not implemented");
43+
return RMW_RET_UNSUPPORTED;
44+
}
45+
46+
rmw_ret_t
47+
rmw_client_set_on_new_response_callback(
48+
rmw_client_t * client,
49+
rmw_event_callback_t callback,
50+
const void * user_data)
51+
{
52+
(void) client;
53+
(void) callback;
54+
(void) user_data;
55+
56+
RMW_UROS_TRACE_MESSAGE("function not implemented");
57+
return RMW_RET_UNSUPPORTED;
58+
}
59+
60+
rmw_ret_t
61+
rmw_event_set_callback(
62+
rmw_event_t * event,
63+
rmw_event_callback_t callback,
64+
const void * user_data)
65+
{
66+
(void) event;
67+
(void) callback;
68+
(void) user_data;
69+
70+
RMW_UROS_TRACE_MESSAGE("function not implemented");
71+
return RMW_RET_UNSUPPORTED;
72+
}

rmw_microxrcedds_c/src/rmw_publisher.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ rmw_publisher_get_actual_qos(
281281
const rmw_publisher_t * publisher,
282282
rmw_qos_profile_t * qos)
283283
{
284-
(void)qos;
284+
(void) qos;
285285

286286
rmw_uxrce_publisher_t * custom_publisher = (rmw_uxrce_publisher_t *)publisher->data;
287287
qos = &custom_publisher->qos;

rmw_microxrcedds_c/src/rmw_service.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,29 @@ rmw_destroy_service(
236236

237237
return result_ret;
238238
}
239+
240+
rmw_ret_t
241+
rmw_service_response_publisher_get_actual_qos(
242+
const rmw_service_t * service,
243+
rmw_qos_profile_t * qos)
244+
{
245+
(void) qos;
246+
247+
rmw_uxrce_service_t * custom_service = (rmw_uxrce_service_t *)service->data;
248+
qos = &custom_service->qos;
249+
250+
return RMW_RET_OK;
251+
}
252+
253+
rmw_ret_t
254+
rmw_service_request_subscription_get_actual_qos(
255+
const rmw_service_t * service,
256+
rmw_qos_profile_t * qos)
257+
{
258+
(void) qos;
259+
260+
rmw_uxrce_service_t * custom_service = (rmw_uxrce_service_t *)service->data;
261+
qos = &custom_service->qos;
262+
263+
return RMW_RET_OK;
264+
}

rmw_microxrcedds_c/src/rmw_subscription.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ rmw_subscription_get_actual_qos(
276276
const rmw_subscription_t * subscription,
277277
rmw_qos_profile_t * qos)
278278
{
279-
(void)qos;
279+
(void) qos;
280280

281281
rmw_uxrce_subscription_t * custom_subscription = (rmw_uxrce_subscription_t *)subscription->data;
282282
qos = &custom_subscription->qos;

0 commit comments

Comments
 (0)