From 9044b282cfb1088e918586df1cdce453cc105596 Mon Sep 17 00:00:00 2001 From: Christopher Wecht Date: Tue, 6 Feb 2024 11:08:02 +0100 Subject: [PATCH] Add DDS_TIME_INVALID and DDS_Time_is_invalid for connext micro Signed-off-by: Christopher Wecht --- rmw_connextdds_common/include/rmw_connextdds/dds_api.hpp | 4 ++-- .../include/rmw_connextdds/dds_api_rtime.hpp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/rmw_connextdds_common/include/rmw_connextdds/dds_api.hpp b/rmw_connextdds_common/include/rmw_connextdds/dds_api.hpp index 55a3a0b9..9fb701d9 100644 --- a/rmw_connextdds_common/include/rmw_connextdds/dds_api.hpp +++ b/rmw_connextdds_common/include/rmw_connextdds/dds_api.hpp @@ -48,8 +48,8 @@ enum RMW_Connext_MessageType struct RMW_Connext_WriteParams { - DDS_Time_t timestamp{DDS_TIME_INVALID}; - int64_t sequence_number{0}; + DDS_Time_t timestamp = DDS_TIME_INVALID; + int64_t sequence_number = 0L; }; RMW_CONNEXTDDS_PUBLIC extern const char * const RMW_CONNEXTDDS_ID; diff --git a/rmw_connextdds_common/include/rmw_connextdds/dds_api_rtime.hpp b/rmw_connextdds_common/include/rmw_connextdds/dds_api_rtime.hpp index d73b15af..b8e6cbd1 100644 --- a/rmw_connextdds_common/include/rmw_connextdds/dds_api_rtime.hpp +++ b/rmw_connextdds_common/include/rmw_connextdds/dds_api_rtime.hpp @@ -73,4 +73,9 @@ struct DDS_LifespanQosPolicy; // Not available function #define DDS_DataWriter_wait_for_acknowledgments(writer_, timeout_) DDS_RETCODE_UNSUPPORTED +#define DDS_Time_is_invalid(timePtr) \ + ((timePtr)->sec < 0) + +#define DDS_TIME_INVALID {-1L, 0UL} + #endif // RMW_CONNEXTDDS__DDS_API_RTIME_HPP_