Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update doc for rmw_get_node_names to mention potential null values #214

Merged
merged 1 commit into from
Mar 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rcl/include/rcl/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ rcl_names_and_types_fini(rcl_names_and_types_t * names_and_types);
* The node_names parameter must be allocated and zero initialized.
* The node_names is the output for this function, and contains
* allocated memory.
* Note that entries in the array might contain `NULL` value.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, what causes an entry to have a NULL value?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A participant without a "ROS node name" will result in a NULL value. That can e.g. happen when the DDS implementation has some entities running all the time or is there is a vanilla DDS participant which doesn't have a node name defined in ROS.

* Use rcutils_get_zero_initialized_string_array() for initializing an empty
* rcutils_string_array_t struct.
* This node_names struct should therefore be passed to rcutils_string_array_fini()
Expand Down