Update rmw_publish() error returns (#239)
Signed-off-by: lobotuerk <jtlorente@ekumenlabs.com>
This commit is contained in:
parent
16e27f6504
commit
3160c181f7
1 changed files with 9 additions and 3 deletions
|
@ -1505,9 +1505,15 @@ extern "C" rmw_ret_t rmw_publish(
|
||||||
rmw_publisher_allocation_t * allocation)
|
rmw_publisher_allocation_t * allocation)
|
||||||
{
|
{
|
||||||
static_cast<void>(allocation); // unused
|
static_cast<void>(allocation); // unused
|
||||||
RET_NULL(publisher);
|
RMW_CHECK_FOR_NULL_WITH_MSG(
|
||||||
RET_WRONG_IMPLID(publisher);
|
publisher, "publisher handle is null",
|
||||||
RET_NULL(ros_message);
|
return RMW_RET_INVALID_ARGUMENT);
|
||||||
|
RMW_CHECK_TYPE_IDENTIFIERS_MATCH(
|
||||||
|
publisher, publisher->implementation_identifier, eclipse_cyclonedds_identifier,
|
||||||
|
return RMW_RET_INCORRECT_RMW_IMPLEMENTATION);
|
||||||
|
RMW_CHECK_FOR_NULL_WITH_MSG(
|
||||||
|
ros_message, "ros message handle is null",
|
||||||
|
return RMW_RET_INVALID_ARGUMENT);
|
||||||
auto pub = static_cast<CddsPublisher *>(publisher->data);
|
auto pub = static_cast<CddsPublisher *>(publisher->data);
|
||||||
assert(pub);
|
assert(pub);
|
||||||
if (dds_write(pub->enth, ros_message) >= 0) {
|
if (dds_write(pub->enth, ros_message) >= 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue