Skip to content

Commit

Permalink
Release v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogs9 authored Nov 30, 2021
2 parents 69134a9 + 07fa1a7 commit bdaddba
Show file tree
Hide file tree
Showing 136 changed files with 13,339 additions and 310 deletions.
133 changes: 128 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ cmake_minimum_required(VERSION 3.5.0 FATAL_ERROR)
###############################################################################
# Build options
###############################################################################
option(UCLIENT_BUILD_MICROCDR "Force local build of Micro CDR." OFF)
option(UCLIENT_SUPERBUILD "Enable superbuild compilation." ON)
option(UCLIENT_BUILD_TESTS "Build tests." OFF)
option(UCLIENT_BUILD_EXAMPLES "Build examples." OFF)
Expand All @@ -29,6 +30,7 @@ option(UCLIENT_VERBOSE_MESSAGE "Build with message verbosity." OFF)
option(UCLIENT_PIC "Control Position Independent Code." ON)
option(UCLIENT_ISOLATED_INSTALL "Install the project and dependencies into separeted folders with version control." OFF)
option(BUILD_SHARED_LIBS "Control shared/static library building." OFF)
option(BUILD_DOCUMENTATION "Use doxygen to create product documentation" OFF)

option(UCLIENT_BUILD_CI_TESTS "Build CI test cases." OFF)
if(UCLIENT_BUILD_CI_TESTS)
Expand All @@ -45,6 +47,7 @@ option(UCLIENT_BIG_ENDIANNESS "Set the machine endianness to big endianness (by
option(UCLIENT_PROFILE_DISCOVERY "Enable discovery profile." ON)
option(UCLIENT_PROFILE_UDP "Enable UDP transport." ON)
option(UCLIENT_PROFILE_TCP "Enable TCP transport." ON)
option(UCLIENT_PROFILE_CAN "Enable CAN FD transport." OFF)
option(UCLIENT_PROFILE_SERIAL "Enable Serial transport." ON)
option(UCLIENT_PROFILE_STREAM_FRAMING "Enable stream framing protocol." ON)
set(UCLIENT_MAX_OUTPUT_BEST_EFFORT_STREAMS 1 CACHE STRING "Set the maximum number of output best-effort streams for session.")
Expand All @@ -53,19 +56,28 @@ set(UCLIENT_MAX_INPUT_BEST_EFFORT_STREAMS 1 CACHE STRING "Set the maximum number
set(UCLIENT_MAX_INPUT_RELIABLE_STREAMS 1 CACHE STRING "Set the maximum number of input reliable streams for session.")
set(UCLIENT_MAX_SESSION_CONNECTION_ATTEMPTS 10 CACHE STRING "Set the number of connection attemps.")
set(UCLIENT_MIN_SESSION_CONNECTION_INTERVAL 1000 CACHE STRING "Set the connection interval in milliseconds.")
set(UCLIENT_MIN_HEARTBEAT_TIME_INTERVAL 1 CACHE STRING "Set the time interval between heartbeats in milliseconds.")
set(UCLIENT_MIN_HEARTBEAT_TIME_INTERVAL 100 CACHE STRING "Set the time interval between heartbeats in milliseconds.")
set(UCLIENT_UDP_TRANSPORT_MTU 512 CACHE STRING "Set the UDP transport MTU.")
set(UCLIENT_TCP_TRANSPORT_MTU 512 CACHE STRING "Set the TCP transport MTU.")
set(UCLIENT_SERIAL_TRANSPORT_MTU 512 CACHE STRING "Set the Serial transport MTU.")

option(UCLIENT_PROFILE_CUSTOM_TRANSPORT "Enable Custom transport." ON)
set(UCLIENT_CUSTOM_TRANSPORT_MTU 512 CACHE STRING "Set the Custom transport MTU.")

option(UCLIENT_PROFILE_MULTITHREAD "Enable multithread support." OFF)
option(UCLIENT_PROFILE_SHARED_MEMORY "Enable shared memory transport support." OFF)
option(UCLIENT_PROFILE_MATCHING "Enable QoS matching support." OFF)
set(UCLIENT_SHARED_MEMORY_MAX_ENTITIES 4 CACHE STRING "Max number of entities involved in shared memory.")
set(UCLIENT_SHARED_MEMORY_STATIC_MEM_SIZE 10 CACHE STRING "Max number data buffers stored in shared memory")

# Off-standard features and tweaks
option(UCLIENT_TWEAK_XRCE_WRITE_LIMIT "This feature uses a tweak to allow XRCE WRITE DATA submessages grater than 64 kB." ON)

###############################################################################
# Dependencies
###############################################################################
set(_microcdr_version 1.2.1)
set(_microcdr_tag v1.2.1)
set(_microcdr_version 2.0.0)
set(_microcdr_tag v2.0.0)

set(_deps "")
list(APPEND _deps "microcdr\;${_microcdr_version}")
Expand All @@ -75,7 +87,7 @@ list(APPEND _deps "microcdr\;${_microcdr_version}")
###############################################################################
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
if(NOT UCLIENT_SUPERBUILD)
project(microxrcedds_client VERSION "2.0.0" LANGUAGES C)
project(microxrcedds_client VERSION "2.1.0" LANGUAGES C)
else()
project(uclient_superbuild NONE)
include(${PROJECT_SOURCE_DIR}/cmake/SuperBuild.cmake)
Expand Down Expand Up @@ -125,7 +137,7 @@ endforeach()
# Sources
###############################################################################
# Check platform.
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
set(UCLIENT_PLATFORM_LINUX ON)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(UCLIENT_PLATFORM_WINDOWS ON)
Expand All @@ -138,6 +150,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Generic")
set(UCLIENT_PLATFORM_POSIX_NOPOLL ON)
elseif(PLATFORM_NAME STREQUAL "FreeRTOS_Plus_TCP")
set(UCLIENT_PLATFORM_FREERTOS_PLUS_TCP ON)
elseif(PLATFORM_NAME STREQUAL "RTEMS_BSD_NET")
set(UCLIENT_PLATFORM_RTEMS_BSD_NET ON)
endif()
endif()

Expand All @@ -158,6 +172,8 @@ if(UCLIENT_PROFILE_UDP)
list(APPEND _transport_src src/c/profile/transport/ip/udp/udp_transport_windows.c)
elseif(UCLIENT_PLATFORM_FREERTOS_PLUS_TCP)
list(APPEND _transport_src src/c/profile/transport/ip/udp/udp_transport_freertos_plus_tcp.c)
elseif(UCLIENT_PLATFORM_RTEMS_BSD_NET)
list(APPEND _transport_src src/c/profile/transport/ip/udp/udp_transport_rtems_bsd_net.c)
endif()
endif()

Expand All @@ -169,11 +185,14 @@ if(UCLIENT_PROFILE_TCP)
list(APPEND _transport_src src/c/profile/transport/ip/tcp/tcp_transport_windows.c)
elseif(UCLIENT_PLATFORM_FREERTOS_PLUS_TCP)
list(APPEND _transport_src src/c/profile/transport/ip/tcp/tcp_transport_freertos_plus_tcp.c)
elseif(UCLIENT_PLATFORM_RTEMS_BSD_NET)
list(APPEND _transport_src src/c/profile/transport/ip/tcp/tcp_transport_rtems_bsd_net.c)
endif()
endif()

if(UCLIENT_PLATFORM_WINDOWS)
set(UCLIENT_PROFILE_SERIAL OFF)
set(UCLIENT_PROFILE_CAN OFF)
endif()

if(UCLIENT_PROFILE_SERIAL)
Expand All @@ -184,6 +203,11 @@ if(UCLIENT_PROFILE_SERIAL)
endif()
endif()

if(UCLIENT_PROFILE_CAN AND UCLIENT_PLATFORM_POSIX)
list(APPEND _transport_src src/c/profile/transport/can/can_transport.c)
list(APPEND _transport_src src/c/profile/transport/can/can_transport_posix.c)
endif()

if(UCLIENT_PROFILE_DISCOVERY OR UCLIENT_PROFILE_UDP OR UCLIENT_PROFILE_TCP)
if(UCLIENT_PLATFORM_POSIX)
list(APPEND _transport_src src/c/profile/transport/ip/ip_posix.c)
Expand All @@ -193,6 +217,8 @@ if(UCLIENT_PROFILE_DISCOVERY OR UCLIENT_PROFILE_UDP OR UCLIENT_PROFILE_TCP)
list(APPEND _transport_src src/c/profile/transport/ip/ip_windows.c)
elseif(UCLIENT_PLATFORM_FREERTOS_PLUS_TCP)
list(APPEND _transport_src src/c/profile/transport/ip/ip_freertos_plus_tcp.c)
elseif(UCLIENT_PLATFORM_RTEMS_BSD_NET)
list(APPEND _transport_src src/c/profile/transport/ip/ip_rtems_bsd_net.c)
endif()
endif()

Expand All @@ -207,13 +233,19 @@ if(UCLIENT_PROFILE_DISCOVERY)
list(APPEND _transport_src src/c/profile/discovery/transport/udp_transport_datagram_windows.c)
elseif(UCLIENT_PLATFORM_FREERTOS_PLUS_TCP)
list(APPEND _transport_src src/c/profile/discovery/transport/udp_transport_datagram_freertos_plus_tcp.c)
elseif(UCLIENT_PLATFORM_RTEMS_BSD_NET)
list(APPEND _transport_src src/c/profile/discovery/transport/udp_transport_datagram_rtems_bsd_net.c)
endif()
endif()

if(UCLIENT_PROFILE_CUSTOM_TRANSPORT)
list(APPEND _transport_src src/c/profile/transport/custom/custom_transport.c)
endif()

if(UCLIENT_PROFILE_SHARED_MEMORY)
set(UCLIENT_PROFILE_MATCHING ON)
endif()

# Other sources
set(SRCS
src/c/core/session/stream/input_best_effort_stream.c
Expand All @@ -235,8 +267,12 @@ set(SRCS
src/c/core/session/common_create_entities.c
src/c/core/session/create_entities_ref.c
src/c/core/session/create_entities_xml.c
src/c/core/session/create_entities_bin.c
src/c/core/session/read_access.c
src/c/core/session/write_access.c
$<$<BOOL:${UCLIENT_PROFILE_MULTITHREAD}>:src/c/profile/multithread/multithread.c>
$<$<BOOL:${UCLIENT_PROFILE_SHARED_MEMORY}>:src/c/profile/shared_memory/shared_memory.c>
$<$<BOOL:${UCLIENT_PROFILE_MATCHING}>:src/c/profile/matching/matching.c>
$<$<BOOL:${UCLIENT_PROFILE_STREAM_FRAMING}>:src/c/profile/transport/stream_framing/stream_framing_protocol.c>
$<$<OR:$<BOOL:${UCLIENT_VERBOSE_MESSAGE}>,$<BOOL:${UCLIENT_VERBOSE_SERIALIZATION}>>:src/c/core/log/log.c>
${_transport_src}
Expand All @@ -256,10 +292,13 @@ set(LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH "Installation dir
set(DATA_INSTALL_DIR ${CMAKE_INSTALL_DATADIR} CACHE PATH "Installation directory for data")
if(WIN32)
set(LICENSE_INSTALL_DIR . CACHE PATH "Installation directory for licenses")
set(DOC_DIR "doc")
else()
set(LICENSE_INSTALL_DIR ${DATA_INSTALL_DIR}/${PROJECT_NAME} CACHE PATH "Installation directory for licenses")
set(DOC_DIR "${DATA_INSTALL_DIR}/doc")
endif()

set(DOC_INSTALL_DIR ${DOC_DIR} CACHE PATH "Installation directory for documentation")
###############################################################################
# Targets
###############################################################################
Expand Down Expand Up @@ -303,12 +342,17 @@ if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND (UCLIENT_TARGET_TYPE STREQUAL "SHA
)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
find_package(Threads REQUIRED)
endif()

target_link_libraries(${PROJECT_NAME}
PUBLIC
microcdr
$<$<BOOL:$<PLATFORM_ID:Windows>>:ws2_32>
PRIVATE
$<$<BOOL:$<PLATFORM_ID:Linux>>:rt>
$<$<BOOL:$<PLATFORM_ID:Linux>>:${CMAKE_THREAD_LIBS_INIT}>
)
target_include_directories(${PROJECT_NAME}
PUBLIC
Expand Down Expand Up @@ -362,9 +406,20 @@ if(UCLIENT_BUILD_EXAMPLES)
add_subdirectory(examples/ContinuousFragment)
add_subdirectory(examples/PublishHelloWorldBestEffort)
add_subdirectory(examples/SubscribeHelloWorldBestEffort)
add_subdirectory(examples/BinaryEntityCreation)

if(UCLIENT_PLATFORM_LINUX)
add_subdirectory(examples/CustomTransports)
endif()

if(UCLIENT_PROFILE_CAN)
add_subdirectory(examples/PublishHelloWorldCAN)
endif()

if(UCLIENT_PROFILE_SHARED_MEMORY)
add_subdirectory(examples/SharedMemoryPubSub)
add_subdirectory(examples/SharedMemoryReqRep)
endif()
endif()

###############################################################################
Expand All @@ -387,13 +442,70 @@ if(UCLIENT_BUILD_TESTS)
if(UCLIENT_PLATFORM_LINUX)
add_subdirectory(test/transport/custom_comm)
add_subdirectory(test/transport/serial_comm)
add_subdirectory(test/shared_memory)
endif()
endif()

if(UCLIENT_PLATFORM_LINUX AND UCLIENT_MEMORY_TESTS)
add_subdirectory(test/memory/consumption)
endif()

###############################################################################
# Documentation
###############################################################################
if(BUILD_DOCUMENTATION)
find_package(Doxygen)
if(NOT DOXYGEN_FOUND)
message(FATAL_ERROR "doxygen is needed to build the documentation. Please install it correctly")
endif()
if(UNIX)
find_program(DOXYFILE_MAKE make)
if(DOXYFILE_MAKE)
message(STATUS "Found Make: ${DOXYFILE_MAKE}")
else()
message(FATAL_ERROR "make is needed to build the documentation. Please install it correctly")
endif()
elseif(WIN32)
set(DOXYFILE_MAKE make.bat)
endif()

find_program(WGET_EXE wget)
if(WGET_EXE)
message(STATUS "Found WGet: ${WGET_EXE}")
else()
message(FATAL_ERROR "wget is needed to build the documentation. Please install it correctly")
endif()
find_program(UNZIP_EXE unzip)
if(UNZIP_EXE)
message(STATUS "Found Unzip: ${UNZIP_EXE}")
else()
message(FATAL_ERROR "unzip is needed to build the documentation. Please install it correctly")
endif()


# Target to create documentation directories
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc)
add_custom_target(docdirs
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/doc/api_reference
COMMENT "Creating documentation directory" VERBATIM)

### Doxygen ########################3
# Configure the template doxyfile for or specific project
configure_file(doxyfile.in ${PROJECT_BINARY_DIR}/doxyfile @ONLY IMMEDIATE)
# Add custom target to run doxygen when ever the project is build
add_custom_target(doxygen
COMMAND "${DOXYGEN_EXECUTABLE}" "${PROJECT_BINARY_DIR}/doxyfile"
SOURCES "${PROJECT_BINARY_DIR}/doxyfile"
COMMENT "Generating API documentation with doxygen" VERBATIM)

add_dependencies(doxygen docdirs)

add_custom_target(doc ALL
COMMENT "Generated project documentation" VERBATIM)

add_dependencies(doc doxygen)
endif()

###############################################################################
# Packaging
###############################################################################
Expand Down Expand Up @@ -489,3 +601,14 @@ if(EXISTS ${CMAKE_BINARY_DIR}/temp_install/)
)
endforeach()
endif()

# Set output library prefix
set_property(TARGET microxrcedds_client PROPERTY PREFIX ${LIB_PREFIX})

if(BUILD_DOCUMENTATION)
# Instalation of doxygen files
install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/api_reference
DESTINATION ${DOC_INSTALL_DIR}
COMPONENT documentation
)
endif()
3 changes: 2 additions & 1 deletion QUALITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ The public API is documented [in oficial documentation Read the Docs](https://mi

### ABI Stability Policy [1.v]

Any ABI break in **eProsima Micro XRCE-DDS Client** will be done between minor versions and it should be clearly stated in the release notes.
Any ABI break in **eProsima Micro XRCE-DDS Client** will be done between minor versions and it should be clearly stated in the release notes, note that minor releases can happen within a ROS distribution.


## Change Control Process [2]

Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
*eProsima Micro XRCE-DDS* is a library implementing the [DDS-XRCE protocol](https://www.omg.org/spec/DDS-XRCE/About-DDS-XRCE/) as defined and maintained by the OMG, whose aim is to allow resource constrained devices such as microcontrollers to communicate with the [DDS](https://www.omg.org/spec/DDS/About-DDS/>) world as any other DDS actor would do.
It follows a client/server paradigm and is composed by two libraries, the *Micro XRCE-DDS Client* and the *Micro XRCE-DDS Agent*. The *Micro XRCE-DDS Clients* are lightweight entities meant to be compiled on e**X**tremely **R**esource **C**onstrained **E**nvironments, while the *Micro XRCE-DDS Agent* is a broker which bridges the *Clients* with the DDS world.

<p align="center"> <img src="docs/General.png" alt="Image" width="70%"/> </p>
<p align="center"> <img src="https://github.com/eProsima/Micro-XRCE-DDS-Client/blob/master/docs/General.png?raw=true" alt="General architecture" width="70%"/> </p>

The *Micro XRCE-DDS Clients* request operations to the *Agent* to publish and/or subscribe to topics in the DDS global dataspace. Remote procedure calls, as defined by the [DDS-RPC standard](https://www.omg.org/spec/DDS-RPC/About-DDS-RPC/), are also supported, allowing *Clients* to communicate in the DDS dataspace according to a request/reply paradigm.
The *Agents* process these requests and send back a response with the operation status result and with the requested data, in the case of subscribe/reply operations.
The communication in the DDS world is mediated by a dedicated `ProxyClient` in charge of creating the *DDS Entities* requested by the *Clients*, such as *Participants*, *Topics*, *Publishers*, and *Subscribers*, which can interact with the DDS Global dataspace.

<p align="center"> <img src="docs/Client.png" alt="Image" width="70%"/> </p>
<p align="center"> <img src="https://github.com/eProsima/Micro-XRCE-DDS-Client/blob/master/docs/Client.png?raw=true" alt="Client architecture" width="70%"/> </p>

*eProsima Micro XRCE-DDS* provides the user with a C API to create *Micro XRCE-DDS Clients* applications. The library can be configured at compile-time via a set of CMake flags allowing to enable or disable some profiles before compilation, and to manipulate several parameters controlling some of the library's functionalities, which in turn allow tuning the library size.

Expand All @@ -40,4 +40,3 @@ See the [Quality Declaration](QUALITY.md) for more details.
## Getting Help

If you need support you can reach us by mail at `[email protected]` or by phone at `+34 91 804 34 48`.

6 changes: 5 additions & 1 deletion cmake/SuperBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ enable_language(CXX)

# Micro CDR.
unset(microcdr_DIR CACHE)
find_package(microcdr ${_microcdr_version} EXACT QUIET)

if(NOT UCLIENT_BUILD_MICROCDR)
find_package(microcdr ${_microcdr_version} EXACT QUIET)
endif()

if(NOT microcdr_FOUND)
ExternalProject_Add(microcdr
GIT_REPOSITORY
Expand Down
5 changes: 2 additions & 3 deletions cmake/common/check_configuration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ endmacro()

function(set_common_compile_options target)
enable_language(C)
enable_language(CXX)
if(MSVC OR MSVC_IDE)
target_compile_options(${target} PRIVATE /W4)
else()
Expand All @@ -127,15 +126,15 @@ function(set_common_compile_options target)
-Wunused
$<$<COMPILE_LANGUAGE:CXX>:-Woverloaded-virtual>
-Wconversion
-Wsign-conversion
$<$<CXX_COMPILER_ID:GNU>:-Wlogical-op>
$<$<AND:$<CXX_COMPILER_ID:GNU>,$<COMPILE_LANGUAGE:CXX>>:-Wuseless-cast>
-Wdouble-promotion
$<$<COMPILE_LANGUAGE:CXX>:-Wold-style-cast>
$<$<OR:$<AND:$<CXX_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,6.0.0>>>,$<AND:$<C_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<C_COMPILER_VERSION>,6.0.0>>>>:-Wnull-dereference>
$<$<OR:$<AND:$<CXX_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,7.0.0>>>,$<AND:$<C_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<C_COMPILER_VERSION>,7.0.0>>>>:-Wduplicated-branches>
$<$<OR:$<AND:$<CXX_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,6.0.0>>>,$<AND:$<C_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<C_COMPILER_VERSION>,6.0.0>>>>:-Wduplicated-cond>
$<$<OR:$<AND:$<CXX_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,7.0.0>>>,$<AND:$<C_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<C_COMPILER_VERSION>,7.0.0>>>>:-Wrestrict>
$<$<OR:$<AND:$<CXX_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,4.6.0>>>,$<AND:$<C_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<C_COMPILER_VERSION>,4.6.0>>>>:-Wdouble-promotion>
$<$<OR:$<AND:$<CXX_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,4.3.0>>>,$<AND:$<C_COMPILER_ID:GNU>,$<NOT:$<VERSION_LESS:$<C_COMPILER_VERSION>,4.3.0>>>>:-Wsign-conversion>
)
endif()
endfunction()
Loading

0 comments on commit bdaddba

Please sign in to comment.