diff --git a/rmw_fastrtps_dynamic_cpp/CMakeLists.txt b/rmw_fastrtps_dynamic_cpp/CMakeLists.txt index 33c8e9ddb..3122a5aca 100644 --- a/rmw_fastrtps_dynamic_cpp/CMakeLists.txt +++ b/rmw_fastrtps_dynamic_cpp/CMakeLists.txt @@ -58,6 +58,7 @@ add_library(rmw_fastrtps_dynamic_cpp src/rmw_count.cpp src/rmw_get_gid_for_publisher.cpp src/rmw_get_implementation_identifier.cpp + src/rmw_get_serialization_format.cpp src/rmw_guard_condition.cpp src/rmw_init.cpp src/rmw_node.cpp @@ -77,6 +78,7 @@ add_library(rmw_fastrtps_dynamic_cpp src/rmw_wait.cpp src/rmw_wait_set.cpp src/type_support_common.cpp + src/serialization_format.cpp ) target_link_libraries(rmw_fastrtps_dynamic_cpp fastcdr fastrtps) diff --git a/rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/serialization_format.hpp b/rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/serialization_format.hpp new file mode 100644 index 000000000..de429b844 --- /dev/null +++ b/rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/serialization_format.hpp @@ -0,0 +1,20 @@ +// Copyright 2018 Open Source Robotics Foundation, Inc. +// +// 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. + +#ifndef RMW_FASTRTPS_DYNAMIC_CPP__SERIALIZATION_FORMAT_HPP_ +#define RMW_FASTRTPS_DYNAMIC_CPP__SERIALIZATION_FORMAT_HPP_ + +extern const char * const eprosima_fastrtps_dynamic_serialization_format; + +#endif // RMW_FASTRTPS_DYNAMIC_CPP__SERIALIZATION_FORMAT_HPP_ diff --git a/rmw_fastrtps_dynamic_cpp/src/rmw_get_serialization_format.cpp b/rmw_fastrtps_dynamic_cpp/src/rmw_get_serialization_format.cpp new file mode 100644 index 000000000..7978b1ecc --- /dev/null +++ b/rmw_fastrtps_dynamic_cpp/src/rmw_get_serialization_format.cpp @@ -0,0 +1,26 @@ +// Copyright 2018 Open Source Robotics Foundation, Inc. +// +// 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/rmw.h" + +#include "rmw_fastrtps_dynamic_cpp/serialization_format.hpp" + +extern "C" +{ +const char * +rmw_get_serialization_format() +{ + return eprosima_fastrtps_dynamic_serialization_format; +} +} // extern "C" diff --git a/rmw_fastrtps_dynamic_cpp/src/serialization_format.cpp b/rmw_fastrtps_dynamic_cpp/src/serialization_format.cpp new file mode 100644 index 000000000..03534979a --- /dev/null +++ b/rmw_fastrtps_dynamic_cpp/src/serialization_format.cpp @@ -0,0 +1,17 @@ +// Copyright 2018 Open Source Robotics Foundation, Inc. +// +// 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_fastrtps_dynamic_cpp/serialization_format.hpp" + +const char * const eprosima_fastrtps_dynamic_serialization_format = "cdr";