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

implement with_info version of take #161

Merged
merged 3 commits into from
Apr 24, 2020
Merged
Changes from 2 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
16 changes: 10 additions & 6 deletions rmw_cyclonedds_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2856,7 +2856,7 @@ extern "C" rmw_ret_t rmw_wait(
/////////////////////////////////////////////////////////////////////////////////////////

static rmw_ret_t rmw_take_response_request(
CddsCS * cs, rmw_request_id_t * request_header,
CddsCS * cs, rmw_service_info_t * request_header,
void * ros_data, bool * taken, dds_time_t * source_timestamp,
dds_instance_handle_t srcfilter)
{
Expand All @@ -2870,9 +2870,13 @@ static rmw_ret_t rmw_take_response_request(
while (dds_take(cs->sub->enth, &wrap_ptr, &info, 1, 1) == 1) {
if (info.valid_data) {
memset(request_header, 0, sizeof(wrap.header));
assert(sizeof(wrap.header.guid) <= sizeof(request_header->writer_guid));
memcpy(request_header->writer_guid, &wrap.header.guid, sizeof(wrap.header.guid));
request_header->sequence_number = wrap.header.seq;
assert(sizeof(wrap.header.guid) <= sizeof(request_header->request_id.writer_guid));
memcpy(request_header->request_id.writer_guid, &wrap.header.guid, sizeof(wrap.header.guid));
request_header->request_id.sequence_number = wrap.header.seq;
request_header->source_timestamp = info.source_timestamp;
if (rcutils_system_time_now(&(request_header->received_timestamp)) != RCUTILS_RET_OK) {
request_header->received_timestamp = 0;
}
if (source_timestamp) {
*source_timestamp = info.source_timestamp;
}
Expand All @@ -2888,7 +2892,7 @@ static rmw_ret_t rmw_take_response_request(

extern "C" rmw_ret_t rmw_take_response(
const rmw_client_t * client,
rmw_request_id_t * request_header, void * ros_response,
rmw_service_info_t * request_header, void * ros_response,
bool * taken)
{
RET_WRONG_IMPLID(client);
Expand Down Expand Up @@ -2935,7 +2939,7 @@ static void check_for_blocked_requests(CddsClient & client)

extern "C" rmw_ret_t rmw_take_request(
const rmw_service_t * service,
rmw_request_id_t * request_header, void * ros_request,
rmw_service_info_t * request_header, void * ros_request,
bool * taken)
{
RET_WRONG_IMPLID(service);
Expand Down