Skip to content

Commit 63b71a1

Browse files
authored
Add specific return type for non existent node (#182)
* Add specific return type for non existent node Signed-off-by: ivanpauno <[email protected]>
1 parent 9f2e181 commit 63b71a1

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

rmw/include/rmw/get_node_info_and_types.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ extern "C"
4747
* \return `RMW_RET_OK` if the query was successful, or
4848
* \return `RMW_RET_INVALID_ARGUMENT` if the node is invalid, or
4949
* \return `RMW_RET_INVALID_ARGUMENT` if any arguments are invalid, or
50+
* \return `RMW_RET_NODE_NAME_NON_EXISTENT` if the node name wasn't found, or
5051
* \return `RMW_RET_BAD_ALLOC` if memory allocation fails, or
5152
* \return `RMW_RET_ERROR` if an unspecified error occurs.
5253
*/
@@ -83,6 +84,7 @@ rmw_get_subscriber_names_and_types_by_node(
8384
* \return `RMW_RET_OK` if the query was successful, or
8485
* \return `RMW_RET_INVALID_ARGUMENT` if the node is invalid, or
8586
* \return `RMW_RET_INVALID_ARGUMENT` if any arguments are invalid, or
87+
* \return `RMW_RET_NODE_NAME_NON_EXISTENT` if the node name wasn't found, or
8688
* \return `RMW_RET_BAD_ALLOC` if memory allocation fails, or
8789
* \return `RMW_RET_ERROR` if an unspecified error occurs.
8890
*/
@@ -118,6 +120,7 @@ rmw_get_publisher_names_and_types_by_node(
118120
* \return `RMW_RET_OK` if the query was successful, or
119121
* \return `RMW_RET_INVALID_ARGUMENT` if the node is invalid, or
120122
* \return `RMW_RET_INVALID_ARGUMENT` if any arguments are invalid, or
123+
* \return `RMW_RET_NODE_NAME_NON_EXISTENT` if the node name wasn't found, or
121124
* \return `RMW_RET_BAD_ALLOC` if memory allocation fails, or
122125
* \return `RMW_RET_ERROR` if an unspecified error occurs.
123126
*/
@@ -153,6 +156,7 @@ rmw_get_service_names_and_types_by_node(
153156
* \return `RMW_RET_OK` if the query was successful, or
154157
* \return `RMW_RET_INVALID_ARGUMENT` if the node is invalid, or
155158
* \return `RMW_RET_INVALID_ARGUMENT` if any arguments are invalid, or
159+
* \return `RMW_RET_NODE_NAME_NON_EXISTENT` if the node name wasn't found, or
156160
* \return `RMW_RET_BAD_ALLOC` if memory allocation fails, or
157161
* \return `RMW_RET_ERROR` if an unspecified error occurs.
158162
*/

rmw/include/rmw/ret_types.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ typedef int32_t rmw_ret_t;
3636
/// Incorrect rmw implementation.
3737
#define RMW_RET_INCORRECT_RMW_IMPLEMENTATION 12
3838

39+
// rmw node specific ret codes in 2XX
40+
/// Failed to find node name
41+
// Using same return code than in rcl
42+
#define RMW_RET_NODE_NAME_NON_EXISTENT 203
43+
3944
#ifdef __cplusplus
4045
}
4146
#endif

0 commit comments

Comments
 (0)