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

Indicate missing support for unique network flows #282

Merged
merged 4 commits into from
Apr 5, 2021
Merged
Show file tree
Hide file tree
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 rmw_cyclonedds_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ ament_export_dependencies(rosidl_typesupport_introspection_c)
ament_export_dependencies(rosidl_typesupport_introspection_cpp)

add_library(rmw_cyclonedds_cpp
src/rmw_get_network_flow_endpoints.cpp
src/rmw_node.cpp
src/serdata.cpp
src/serdes.cpp
Expand Down
47 changes: 47 additions & 0 deletions rmw_cyclonedds_cpp/src/rmw_get_network_flow_endpoints.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright 2021 Ericsson AB
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "rmw/error_handling.h"
#include "rmw/get_network_flow_endpoints.h"
#include "rmw/rmw.h"
#include "rmw/types.h"

extern "C"
{
rmw_ret_t
rmw_publisher_get_network_flow_endpoints(
const rmw_publisher_t * publisher,
rcutils_allocator_t * allocator,
rmw_network_flow_endpoint_array_t * network_flow_endpoint_array)
{
(void) publisher;
(void) allocator;
(void) network_flow_endpoint_array;
RMW_SET_ERROR_MSG("rmw_publisher_get_network_flow_endpoints not implemented");
return RMW_RET_UNSUPPORTED;
}

rmw_ret_t
rmw_subscription_get_network_flow_endpoints(
const rmw_subscription_t * subscription,
rcutils_allocator_t * allocator,
rmw_network_flow_endpoint_array_t * network_flow_endpoint_array)
{
(void) subscription;
(void) allocator;
(void) network_flow_endpoint_array;
RMW_SET_ERROR_MSG("rmw_subscription_get_network_flow_endpoints not implemented");
return RMW_RET_UNSUPPORTED;
}
} // extern "C"
14 changes: 14 additions & 0 deletions rmw_cyclonedds_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2047,6 +2047,13 @@ extern "C" rmw_publisher_t * rmw_create_publisher(
}
}
RMW_CHECK_ARGUMENT_FOR_NULL(publisher_options, nullptr);
if (publisher_options->require_unique_network_flow_endpoints ==
RMW_UNIQUE_NETWORK_FLOW_ENDPOINTS_STRICTLY_REQUIRED)
{
RMW_SET_ERROR_MSG(
"Strict requirement on unique network flow endpoints for publishers not supported");
return nullptr;
}

rmw_publisher_t * pub = create_publisher(
node->context->impl->ppant, node->context->impl->dds_pub,
Expand Down Expand Up @@ -2425,6 +2432,13 @@ extern "C" rmw_subscription_t * rmw_create_subscription(
}
}
RMW_CHECK_ARGUMENT_FOR_NULL(subscription_options, nullptr);
if (subscription_options->require_unique_network_flow_endpoints ==
RMW_UNIQUE_NETWORK_FLOW_ENDPOINTS_STRICTLY_REQUIRED)
{
RMW_SET_ERROR_MSG(
"Strict requirement on unique network flow endpoints for subscriptions not supported");
return nullptr;
}

rmw_subscription_t * sub = create_subscription(
node->context->impl->ppant, node->context->impl->dds_sub,
Expand Down