|
| 1 | +// Copyright 2021 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 | +/** |
| 16 | + * @file |
| 17 | + */ |
| 18 | + |
| 19 | +#ifndef RMW_MICROROS__TIMING_H_ |
| 20 | +#define RMW_MICROROS__TIMING_H_ |
| 21 | + |
| 22 | +#include <rmw/rmw.h> |
| 23 | +#include <rmw/ret_types.h> |
| 24 | +#include <rmw/init_options.h> |
| 25 | +#include <rmw/error_handling.h> |
| 26 | +#include <uxr/client/util/time.h> |
| 27 | + |
| 28 | +#if defined(__cplusplus) |
| 29 | +extern "C" |
| 30 | +{ |
| 31 | +#endif // if defined(__cplusplus) |
| 32 | + |
| 33 | +/** \addtogroup rmw micro-ROS RMW API |
| 34 | + * @{ |
| 35 | + */ |
| 36 | + |
| 37 | +/** |
| 38 | + * \brief Sets the DDS-XRCE session spin time in reliable publication |
| 39 | + * |
| 40 | + * \param[in] publisher publisher where the spin time is configured |
| 41 | + * \param[in] session_timeout time in milliseconds |
| 42 | + * \return RMW_RET_OK when success. |
| 43 | + * \return RMW_RET_INVALID_ARGUMENT If publisher is not valid or unexpected arguments. |
| 44 | + */ |
| 45 | +rmw_ret_t rmw_uros_set_publisher_session_timeout( |
| 46 | + rmw_publisher_t * publisher, |
| 47 | + int session_timeout); |
| 48 | + |
| 49 | +/** |
| 50 | + * \brief Sets the DDS-XRCE session spin time in reliable service server |
| 51 | + * |
| 52 | + * \param[in] service service where the spin time is configured |
| 53 | + * \param[in] session_timeout time in milliseconds |
| 54 | + * \return RMW_RET_OK when success. |
| 55 | + * \return RMW_RET_INVALID_ARGUMENT If service is not valid or unexpected arguments. |
| 56 | + */ |
| 57 | +rmw_ret_t rmw_uros_set_service_session_timeout( |
| 58 | + rmw_service_t * service, |
| 59 | + int session_timeout); |
| 60 | + |
| 61 | +/** |
| 62 | + * \brief Sets the DDS-XRCE session spin time in reliable service client |
| 63 | + * |
| 64 | + * \param[in] client client where the spin time is configured |
| 65 | + * \param[in] session_timeout time in milliseconds |
| 66 | + * \return RMW_RET_OK when success. |
| 67 | + * \return RMW_RET_INVALID_ARGUMENT If client is not valid or unexpected arguments. |
| 68 | + */ |
| 69 | +rmw_ret_t rmw_uros_set_client_session_timeout( |
| 70 | + rmw_client_t * client, |
| 71 | + int session_timeout); |
| 72 | + |
| 73 | +/** @}*/ |
| 74 | + |
| 75 | +#if defined(__cplusplus) |
| 76 | +} |
| 77 | +#endif // if defined(__cplusplus) |
| 78 | + |
| 79 | +#endif // RMW_MICROROS__TIMING_H_ |
0 commit comments