Skip to content

Commit

Permalink
Release v2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogs9 authored Sep 28, 2022
2 parents 851bbbf + a0bc8c7 commit f984380
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ option(UAGENT_SECURITY_PROFILE "Build security profile." OFF)
option(UAGENT_BUILD_EXECUTABLE "Build Micro XRCE-DDS Agent provided executable." ON)
option(UAGENT_BUILD_USAGE_EXAMPLES "Build Micro XRCE-DDS Agent built-in usage examples" OFF)

set(UAGENT_P2P_CLIENT_VERSION 2.2.0 CACHE STRING "Sets Micro XRCE-DDS client version for P2P")
set(UAGENT_P2P_CLIENT_TAG v2.2.0 CACHE STRING "Sets Micro XRCE-DDS client tag for P2P")
set(UAGENT_P2P_CLIENT_VERSION 2.2.1 CACHE STRING "Sets Micro XRCE-DDS client version for P2P")
set(UAGENT_P2P_CLIENT_TAG v2.2.1 CACHE STRING "Sets Micro XRCE-DDS client tag for P2P")

option(UAGENT_BUILD_CI_TESTS "Build CI test cases.")
if(UAGENT_BUILD_CI_TESTS)
Expand Down Expand Up @@ -80,8 +80,8 @@ set(_deps "")
if(UAGENT_USE_SYSTEM_FASTCDR)
set(_fastcdr_version 1)
else()
set(_fastcdr_version 1.0.22)
set(_fastcdr_tag v1.0.22)
set(_fastcdr_version 1.0.24)
set(_fastcdr_tag v1.0.24)
endif()
list(APPEND _deps "fastcdr\;${_fastcdr_version}")

Expand All @@ -95,8 +95,8 @@ if(UAGENT_FAST_PROFILE)
if(UAGENT_USE_SYSTEM_FASTDDS)
set(_fastdds_version 2)
else()
set(_fastdds_version 2.4.1)
set(_fastdds_tag v2.4.1)
set(_fastdds_version 2.8)
set(_fastdds_tag 2.8.x)
set(_foonathan_memory_tag v0.7-1) # This tag should be updated every time it gets updated in foonathan_memory_vendor eProsima's package
endif()
list(APPEND _deps "fastrtps\;${_fastdds_version}")
Expand All @@ -117,7 +117,7 @@ endif()
###############################################################################
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
if(NOT UAGENT_SUPERBUILD)
project(microxrcedds_agent VERSION "2.2.0" LANGUAGES C CXX)
project(microxrcedds_agent VERSION "2.2.1" LANGUAGES C CXX)
else()
project(uagent_superbuild NONE)
include(${PROJECT_SOURCE_DIR}/cmake/SuperBuild.cmake)
Expand Down
19 changes: 16 additions & 3 deletions include/uxr/agent/message/InputMessage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ class InputMessage
deserializer_(fastbuffer_)
{
memcpy(buf_, buf, len);
deserialize(header_);

// A valid XRCE message must have a valid header and at least 1 submessage
valid_xrce_message_ = deserialize(header_);
valid_xrce_message_ = valid_xrce_message_ && count_submessages() > 0;
}

uint8_t* get_buf() const { return buf_; }
Expand Down Expand Up @@ -70,6 +73,8 @@ class InputMessage

size_t count_submessages();

bool is_valid_xrce_message() { return valid_xrce_message_; }

dds::xrce::SubmessageId get_submessage_id();

private:
Expand All @@ -85,6 +90,7 @@ class InputMessage
dds::xrce::SubmessageHeader subheader_;
fastcdr::FastBuffer fastbuffer_;
fastcdr::Cdr deserializer_;
bool valid_xrce_message_ = false;
};

inline bool InputMessage::prepare_next_submessage()
Expand Down Expand Up @@ -114,8 +120,15 @@ inline size_t InputMessage::count_submessages()
local_deserializer.jump((4 - ((local_deserializer.getCurrentPosition() - local_deserializer.getBufferPointer()) & 3)) & 3);
if (fastbuffer_.getBufferSize() > local_deserializer.getSerializedDataLength())
{
local_subheader.deserialize(local_deserializer);
count++;
try
{
local_subheader.deserialize(local_deserializer);
count++;
}
catch(eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/)
{
rv = false;
}
} else {
rv = false;
}
Expand Down
2 changes: 2 additions & 0 deletions src/cpp/middleware/fastdds/FastDDSMiddleware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ bool FastDDSMiddleware::create_requester_by_bin(

attrs.publisher.historyMemoryPolicy = fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
attrs.subscriber.historyMemoryPolicy = fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
attrs.subscriber.qos.m_reliability.kind = fastdds::dds::RELIABLE_RELIABILITY_QOS;

std::shared_ptr<FastDDSRequester> requester = create_requester(participant, attrs);
if (nullptr == requester)
Expand Down Expand Up @@ -699,6 +700,7 @@ bool FastDDSMiddleware::create_replier_by_bin(

attrs.publisher.historyMemoryPolicy = fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
attrs.subscriber.historyMemoryPolicy = fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
attrs.subscriber.qos.m_reliability.kind = fastdds::dds::RELIABLE_RELIABILITY_QOS;

std::shared_ptr<FastDDSReplier> replier = create_replier(participant, attrs);
if (nullptr == replier)
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/transport/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ void Server<EndPoint>::receiver_loop()
TransportRc transport_rc = TransportRc::ok;
if (recv_message(input_packet, RECEIVE_TIMEOUT, transport_rc))
{
if(dds::xrce::HEARTBEAT == input_packet.message->get_submessage_id() && 1U == input_packet.message->count_submessages()){
if(input_packet.message->is_valid_xrce_message() && 1U == input_packet.message->count_submessages() && dds::xrce::HEARTBEAT == input_packet.message->get_submessage_id()){
input_scheduler_.push(std::move(input_packet), 1);
}
else
Expand Down

0 comments on commit f984380

Please sign in to comment.