Skip to content

Commit

Permalink
Implement rmw_get_gid_for_client. (#115)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette authored Mar 1, 2024
1 parent 8db8003 commit 3667e9e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions rmw_zenoh_cpp/src/rmw_zenoh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3540,9 +3540,15 @@ rmw_get_gid_for_publisher(const rmw_publisher_t * publisher, rmw_gid_t * gid)
rmw_ret_t
rmw_get_gid_for_client(const rmw_client_t * client, rmw_gid_t * gid)
{
static_cast<void>(client);
static_cast<void>(gid);
return RMW_RET_UNSUPPORTED;
RMW_CHECK_ARGUMENT_FOR_NULL(client, RMW_RET_INVALID_ARGUMENT);
RMW_CHECK_ARGUMENT_FOR_NULL(gid, RMW_RET_INVALID_ARGUMENT);

rmw_client_data_t * client_data = static_cast<rmw_client_data_t *>(client->data);

gid->implementation_identifier = rmw_zenoh_identifier;
memcpy(gid->data, client_data->client_guid, RMW_GID_STORAGE_SIZE);

return RMW_RET_OK;
}

//==============================================================================
Expand Down

0 comments on commit 3667e9e

Please sign in to comment.