Skip to content

Commit

Permalink
Merge branch 'develop' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogs9 authored Mar 29, 2021
2 parents cf71981 + 5124991 commit 69134a9
Show file tree
Hide file tree
Showing 224 changed files with 9,350 additions and 3,264 deletions.
2 changes: 2 additions & 0 deletions .github/dco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require:
members: false
67 changes: 67 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master, develop ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '24 2 * * *'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

#strategy:
#fail-fast: false
#matrix:
# language: [ 'c' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# with:
# languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
139 changes: 108 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,30 @@ if((CMAKE_SYSTEM_NAME STREQUAL "") AND (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
endif()

option(UCLIENT_BIG_ENDIANNESS "Set the machine endianness to big endianness (by default is little endianness)." OFF)

set(UCLIENT_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/client.config" CACHE PATH "Configuration client file.")
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_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.")
set(UCLIENT_MAX_OUTPUT_RELIABLE_STREAMS 1 CACHE STRING "Set the maximum number of output reliable streams for session.")
set(UCLIENT_MAX_INPUT_BEST_EFFORT_STREAMS 1 CACHE STRING "Set the maximum number of input best-effort streams for session.")
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_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.")

###############################################################################
# Dependencies
###############################################################################
set(_microcdr_version 1.2.0)
set(_microcdr_tag v1.2.0)
set(_microcdr_version 1.2.1)
set(_microcdr_tag v1.2.1)

set(_deps "")
list(APPEND _deps "microcdr\;${_microcdr_version}")
Expand All @@ -59,7 +75,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 "1.2.5" LANGUAGES C)
project(microxrcedds_client VERSION "2.0.0" LANGUAGES C)
else()
project(uclient_superbuild NONE)
include(${PROJECT_SOURCE_DIR}/cmake/SuperBuild.cmake)
Expand All @@ -78,13 +94,12 @@ endif()
###############################################################################
# Client configuration options
###############################################################################
set(UCLIENT_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/client.config" CACHE PATH "Optional configuration client file.")
# Load configuration file.
if(EXISTS ${UCLIENT_CONFIG})
configure_file(${UCLIENT_CONFIG} ${PROJECT_SOURCE_DIR}/CMakeCache.txt COPYONLY)
load_cache(${PROJECT_SOURCE_DIR})
file(REMOVE ${PROJECT_SOURCE_DIR}/CMakeCache.txt)
else()
message(FATAL_ERROR "No client.config found.")
endif()

###############################################################################
Expand Down Expand Up @@ -117,19 +132,87 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Generic")
if(PLATFORM_NAME STREQUAL "nuttx")
set(UCLIENT_PLATFORM_NUTTX ON)
elseif(PLATFORM_NAME STREQUAL "zephyr")
set(UCLIENT_PLATFORM_ZEPHYR ON)
elseif(PLATFORM_NAME STREQUAL "LwIP")
set(UCLIENT_PLATFORM_POSIX_NOPOLL ON)
elseif(PLATFORM_NAME STREQUAL "FreeRTOS_Plus_TCP")
set(UCLIENT_PLATFORM_FREERTOS_PLUS_TCP ON)
endif()
endif()

if(UCLIENT_PLATFORM_LINUX OR UCLIENT_PLATFORM_NUTTX)
if(UCLIENT_PLATFORM_LINUX OR UCLIENT_PLATFORM_NUTTX OR UCLIENT_PLATFORM_ZEPHYR)
set(UCLIENT_PLATFORM_POSIX ON)
endif()

# Check external transport.
option(UCLIENT_EXTERNAL_TCP "Enable external TCP transport." OFF)
option(UCLIENT_EXTERNAL_UDP "Enable external UDP transport." OFF)
option(UCLIENT_EXTERNAL_SERIAL "Enable external serial transport." OFF)
# Transport sources.
set(_transport_src)

if(UCLIENT_PROFILE_UDP)
list(APPEND _transport_src src/c/profile/transport/ip/udp/udp_transport.c)
if(UCLIENT_PLATFORM_POSIX)
list(APPEND _transport_src src/c/profile/transport/ip/udp/udp_transport_posix.c)
elseif(UCLIENT_PLATFORM_POSIX_NOPOLL)
list(APPEND _transport_src src/c/profile/transport/ip/udp/udp_transport_posix_nopoll.c)
elseif(UCLIENT_PLATFORM_WINDOWS)
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)
endif()
endif()

if(UCLIENT_PROFILE_TCP)
list(APPEND _transport_src src/c/profile/transport/ip/tcp/tcp_transport.c)
if(UCLIENT_PLATFORM_POSIX)
list(APPEND _transport_src src/c/profile/transport/ip/tcp/tcp_transport_posix.c)
elseif(UCLIENT_PLATFORM_WINDOWS)
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)
endif()
endif()

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

if(UCLIENT_PROFILE_SERIAL)
set(UCLIENT_PROFILE_STREAM_FRAMING ON)
list(APPEND _transport_src src/c/profile/transport/serial/serial_transport.c)
if(UCLIENT_PLATFORM_POSIX)
list(APPEND _transport_src src/c/profile/transport/serial/serial_transport_posix.c)
endif()
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)
elseif(UCLIENT_PLATFORM_POSIX_NOPOLL)
list(APPEND _transport_src src/c/profile/transport/ip/ip_posix.c)
elseif(UCLIENT_PLATFORM_WINDOWS)
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)
endif()
endif()

if(UCLIENT_PROFILE_DISCOVERY)
list(APPEND _transport_src src/c/profile/discovery/discovery.c)
list(APPEND _transport_src src/c/profile/transport/ip/udp/udp_transport.c)
if(UCLIENT_PLATFORM_POSIX)
list(APPEND _transport_src src/c/profile/discovery/transport/udp_transport_datagram_posix.c)
elseif(UCLIENT_PLATFORM_POSIX_NOPOLL)
list(APPEND _transport_src src/c/profile/discovery/transport/udp_transport_datagram_posix_nopoll.c)
elseif(UCLIENT_PLATFORM_WINDOWS)
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)
endif()
endif()

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

# Other sources
set(SRCS
Expand All @@ -148,31 +231,15 @@ set(SRCS
src/c/core/serialization/xrce_header.c
src/c/core/serialization/xrce_subheader.c
src/c/util/time.c
src/c/util/ping.c
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/read_access.c
src/c/core/session/write_access.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>
$<$<BOOL:${PROFILE_DISCOVERY}>:src/c/profile/discovery/discovery.c>
$<$<BOOL:${PROFILE_DISCOVERY}>:src/c/profile/transport/ip/udp/udp_transport.c>
$<$<AND:$<BOOL:${PROFILE_DISCOVERY}>,$<BOOL:${UCLIENT_PLATFORM_POSIX}>>:src/c/profile/discovery/transport/udp_transport_datagram_posix.c>
$<$<AND:$<BOOL:${PROFILE_DISCOVERY}>,$<PLATFORM_ID:Windows>>:src/c/profile/discovery/transport/udp_transport_datagram_windows.c>
$<$<BOOL:${PROFILE_UDP_TRANSPORT}>:src/c/profile/transport/ip/udp/udp_transport.c>
$<$<AND:$<BOOL:${PROFILE_UDP_TRANSPORT}>,$<BOOL:${UCLIENT_PLATFORM_POSIX}>>:src/c/profile/transport/ip/udp/udp_transport_posix.c>
$<$<AND:$<BOOL:${PROFILE_UDP_TRANSPORT}>,$<BOOL:${UCLIENT_PLATFORM_POSIX_NOPOLL}>>:src/c/profile/transport/ip/udp/udp_transport_posix_nopoll.c>
$<$<AND:$<BOOL:${PROFILE_UDP_TRANSPORT}>,$<PLATFORM_ID:Windows>>:src/c/profile/transport/ip/udp/udp_transport_windows.c>
$<$<BOOL:${PROFILE_TCP_TRANSPORT}>:src/c/profile/transport/ip/tcp/tcp_transport.c>
$<$<AND:$<BOOL:${PROFILE_TCP_TRANSPORT}>,$<BOOL:${UCLIENT_PLATFORM_POSIX}>>:src/c/profile/transport/ip/tcp/tcp_transport_posix.c>
$<$<AND:$<BOOL:${PROFILE_TCP_TRANSPORT}>,$<PLATFORM_ID:Windows>>:src/c/profile/transport/ip/tcp/tcp_transport_windows.c>
$<$<AND:$<BOOL:${PROFILE_SERIAL_TRANSPORT}>,$<OR:$<PLATFORM_ID:Linux>,$<PLATFORM_ID:Generic>>>:src/c/profile/transport/serial/serial_transport.c>
$<$<AND:$<BOOL:${PROFILE_SERIAL_TRANSPORT}>,$<OR:$<PLATFORM_ID:Linux>,$<PLATFORM_ID:Generic>>>:src/c/profile/transport/serial/serial_protocol.c>
$<$<AND:$<BOOL:${PROFILE_SERIAL_TRANSPORT}>,$<BOOL:${UCLIENT_PLATFORM_POSIX}>>:src/c/profile/transport/serial/serial_transport_posix.c>
$<$<BOOL:${UCLIENT_EXTERNAL_TCP}>:src/c/profile/transport/ip/tcp/tcp_transport_external.c>
$<$<BOOL:${UCLIENT_EXTERNAL_UDP}>:src/c/profile/transport/ip/udp/udp_transport_external.c>
$<$<BOOL:${UCLIENT_EXTERNAL_SERIAL}>:src/c/profile/transport/serial/serial_transport_external.c>
$<$<OR:$<BOOL:${UCLIENT_PLATFORM_POSIX}>,$<BOOL:${UCLIENT_PLATFORM_POSIX_NOPOLL}>>:src/c/profile/transport/ip/ip_posix.c>
$<$<BOOL:$<PLATFORM_ID:Windows>>:src/c/profile/transport/ip/ip_windows.c>
${_transport_src}
)

###############################################################################
Expand Down Expand Up @@ -289,6 +356,15 @@ if(UCLIENT_BUILD_EXAMPLES)
add_subdirectory(examples/ShapesDemo)
add_subdirectory(examples/SubscribeHelloWorld)
add_subdirectory(examples/SubscribeHelloWorldP2P)
add_subdirectory(examples/TimeSync)
add_subdirectory(examples/TimeSyncWithCb)
add_subdirectory(examples/PingAgent)
add_subdirectory(examples/ContinuousFragment)
add_subdirectory(examples/PublishHelloWorldBestEffort)
add_subdirectory(examples/SubscribeHelloWorldBestEffort)
if(UCLIENT_PLATFORM_LINUX)
add_subdirectory(examples/CustomTransports)
endif()
endif()

###############################################################################
Expand All @@ -309,6 +385,7 @@ if(UCLIENT_BUILD_TESTS)

add_subdirectory(test/unitary)
if(UCLIENT_PLATFORM_LINUX)
add_subdirectory(test/transport/custom_comm)
add_subdirectory(test/transport/serial_comm)
endif()
endif()
Expand Down
37 changes: 37 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Contribution Guidelines

The present document provides a set of guidelines to which contributors must adhere.


- [Contribution Guidelines](#contribution-guidelines)
- [Contributions Licensing](#contributions-licensing)
- [Developer Certificate of Origin](#developer-certificate-of-origin)
- [Code Coverage](#code-coverage)
- [General considerations](#general-considerations)

## Contributions Licensing

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html):

~~~
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
~~~

## Developer Certificate of Origin

Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).

## Code Coverage

As stated in [QUALITY.md](QUALITY.md), all contributions to the project must increase line code coverage.
Because of this, contributors are asked to locally run a coverage assessment that ensures that code coverage has increased when compared to the latest execution of the [nightly coverage CI job](http://jenkins.eprosima.com:8080/view/Micro%20XRCE/job/Micro-XRCE-DDS-Client%20Nightly%20Master%20Linux/coverage/).

## General considerations

Any other contributing policy can be found in [eProsima general guidelines](https://github.com/eProsima/policies/blob/main/CONTRIBUTING.md).
2 changes: 1 addition & 1 deletion CTestConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# MemoryCheck configuration.
find_program(MEMORYCHECK_COMMAND NAMES valgrind)
set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --quiet --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=50 --xml=yes --xml-file=test_%p_memcheck.xml \"--suppressions=${CMAKE_CURRENT_SOURCE_DIR}/ci/valgrind.supp\"")
set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --log-fd=2 --quiet --tool=memcheck --leak-check=yes --show-reachable=yes --error-exitcode=1 --num-callers=50 \"--suppressions=${CMAKE_CURRENT_SOURCE_DIR}/ci/valgrind.supp\"")

# Coverage configuration.
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
Expand Down
47 changes: 47 additions & 0 deletions PLATFORM_SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Platform Support

This document reflects the level of support offered by **eProsima Micro XRCE-DDS Client** on different platforms as per the following
definitions:

## Tier 1

Tier 1 platforms are subjected to our unit test suite and other testing tools on a frequent basis including continuous
integration jobs and nightly jobs.
Errors or bugs discovered in these platforms are prioritized for correction by the development team.
Significant errors discovered in Tier 1 platforms can impact release dates and we strive to resolve all known high
priority errors in Tier 1 platforms prior to new version releases.

## Tier 2

Tier 2 platforms are subject to periodic CI testing which runs both builds and tests with publicly accessible results.
The CI is expected to be run at least within a week from the last relevant changes for the current release of the **Micro XRCE-DDS Client**.
Installation instructions should be available and up-to-date in order for a platform to be listed in this category.
Package-level binary packages may not be provided but providing a downloadable archive of the built workspace is
encouraged.
Errors may be present in released product versions for Tier 2 platforms.
Known errors in Tier 2 platforms will be addressed subject to resource availability on a best effort basis and may or
may not be corrected prior to new version releases.
One or more entities should be committed to continuing support of the platform.

## Tier 3

Tier 3 platforms are those for which community reports indicate that the release is functional.
The development team does not run the unit test suite nor perform any other tests on platforms in Tier 3.
Community members may provide assistance with these platforms.

## Platforms

| Architecture | Ubuntu Focal (20.04) | Windows 10 (VS2019) | Debian Buster (10) |
| ------------ | -------------------- | ------------------- | ------------------ |
| amd64 | Tier 1 [s] | Tier 1 [s] | Tier 3 [s] |
| amd32 | | Tier 1 [s] | |
| arm64 | Tier 3 [s] | | Tier 3 [s] |
| arm32 | Tier 3 [s] | | Tier 3 [s] |

" [s] " Compilation from source.

Other Tier 3 OS:

* FreeRTOS
* Zephyr RTOS
* NuttX
Loading

0 comments on commit 69134a9

Please sign in to comment.