Skip to content

Commit

Permalink
Fix RMW_Connext_Client::is_service_available for micro
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Wecht <cwecht@mailbox.org>
  • Loading branch information
cwecht committed Aug 7, 2023
1 parent fff0668 commit e995625
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rmw_connextdds_common/src/common/rmw_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2576,6 +2576,12 @@ RMW_Connext_Client::enable()
rmw_ret_t
RMW_Connext_Client::is_service_available(bool & available)
{
#if RMW_CONNEXT_DDS_API == RMW_CONNEXT_DDS_API_MICRO
available = 0 < this->request_pub->subscriptions_count() &&
0 < this->reply_sub->publications_count();
return RMW_RET_OK;
#else /* RMW_CONNEXT_DDS_API == RMW_CONNEXT_DDS_API_PRO */

// mark service as available if we have at least one writer and one reader
// matched from the same remote DomainParticipant.
struct DDS_InstanceHandleSeq matched_req_subs = DDS_SEQUENCE_INITIALIZER,
Expand Down Expand Up @@ -2620,6 +2626,7 @@ RMW_Connext_Client::is_service_available(bool & available)
}

return RMW_RET_OK;
#endif /* RMW_CONNEXT_DDS_API == RMW_CONNEXT_DDS_API_PRO */
}

rmw_ret_t
Expand Down

0 comments on commit e995625

Please sign in to comment.