Skip to content

Commit e78f3f4

Browse files
authored
Retrieve HistoryQoS in discovery when available (#829)
Signed-off-by: Mario Dominguez <[email protected]>
1 parent 8dc94e0 commit e78f3f4

File tree

1 file changed

+17
-0
lines changed
  • rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp

1 file changed

+17
-0
lines changed

rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/qos.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,23 @@ rtps_qos_to_rmw_qos(
175175
break;
176176
}
177177
qos->liveliness_lease_duration = dds_duration_to_rmw(rtps_qos.liveliness.lease_duration);
178+
179+
if (rtps_qos.history.has_value()) {
180+
switch (rtps_qos.history->kind) {
181+
case eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS:
182+
qos->history = RMW_QOS_POLICY_HISTORY_KEEP_LAST;
183+
break;
184+
case eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS:
185+
qos->history = RMW_QOS_POLICY_HISTORY_KEEP_ALL;
186+
break;
187+
default:
188+
qos->history = RMW_QOS_POLICY_HISTORY_UNKNOWN;
189+
break;
190+
}
191+
qos->depth = static_cast<size_t>(rtps_qos.history->depth);
192+
} else {
193+
qos->history = RMW_QOS_POLICY_HISTORY_UNKNOWN;
194+
}
178195
}
179196

180197
extern template RMW_FASTRTPS_SHARED_CPP_PUBLIC

0 commit comments

Comments
 (0)