Skip to content

Commit 1344858

Browse files
committed
Printing 'not supported' messages only when enabling something that is not supported
1 parent 1afc392 commit 1344858

File tree

2 files changed

+95
-57
lines changed

2 files changed

+95
-57
lines changed

srcCxx/shape_configurator_rti_connext_micro.h

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,9 @@ static void config_micro()
129129

130130
#if defined(RTI_LINUX)
131131
udp_property->allow_interface[0] = DDS_String_dup("lo");
132-
printf("Configured UDP to allow interface lo\n");
133132
#elif defined(RTI_DARWIN)
134133
udp_property->allow_interface[0] = DDS_String_dup("lo0");
135-
printf("Configured UDP to allow interface lo0\n");
136134
#endif
137-
//udp_property->allow_interface[1] = DDS_String_dup("eth0");
138135

139136
if (!registry->register_component(
140137
NETIO_DEFAULT_UDP_NAME,
@@ -180,17 +177,31 @@ static bool configure_dp_qos(DDS::DomainParticipantQos &dp_qos)
180177
/* if there are more remote or local endpoints, you need to increase these limits */
181178
dp_qos.resource_limits.max_destination_ports = 32;
182179
dp_qos.resource_limits.max_receive_ports = 32;
183-
dp_qos.resource_limits.local_topic_allocation = 2;
184-
dp_qos.resource_limits.local_type_allocation = 2;
180+
dp_qos.resource_limits.local_topic_allocation = 8;
181+
dp_qos.resource_limits.local_type_allocation = 8;
185182
//TODO we need to increase this
186-
dp_qos.resource_limits.local_reader_allocation = 2;
187-
dp_qos.resource_limits.local_writer_allocation = 2;
188-
dp_qos.resource_limits.remote_participant_allocation = 8;
189-
dp_qos.resource_limits.remote_reader_allocation = 8;
190-
dp_qos.resource_limits.remote_writer_allocation = 8;
183+
dp_qos.resource_limits.local_reader_allocation = 8;
184+
dp_qos.resource_limits.local_writer_allocation = 8;
185+
dp_qos.resource_limits.remote_participant_allocation = 16;
186+
dp_qos.resource_limits.remote_reader_allocation = 16;
187+
dp_qos.resource_limits.remote_writer_allocation = 16;
191188
return true;
192189
}
193190

191+
void config_dw_qos(DDS::DataWriterQos &dw_qos) {
192+
dw_qos.resource_limits.max_instances = 500;
193+
dw_qos.resource_limits.max_samples = 500;
194+
dw_qos.resource_limits.max_samples_per_instance = 500;
195+
}
196+
197+
void config_dr_qos(DDS::DataReaderQos &dr_qos) {
198+
dr_qos.resource_limits.max_instances = 500;
199+
dr_qos.resource_limits.max_samples = 500;
200+
dr_qos.resource_limits.max_samples_per_instance = 500;
201+
dr_qos.reader_resource_limits.max_remote_writers = 16;
202+
dr_qos.reader_resource_limits.max_samples_per_remote_writer = 500;
203+
}
204+
194205
uint64_t DDS_UInt8Seq_get_length(DDS_OctetSeq * seq)
195206
{
196207
return seq->length();

srcCxx/shape_main.cxx

Lines changed: 74 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,7 @@ class ShapeOptions {
329329

330330
additional_payload_size = 0;
331331

332-
#if defined(RTI_CONNEXT_MICRO)
333-
take_read_next_instance = false;
334-
#else
335332
take_read_next_instance = true;
336-
#endif
337333

338334
periodic_announcement_period_us = 0;
339335
}
@@ -429,16 +425,6 @@ class ShapeOptions {
429425
color = strdup("BLUE");
430426
logger.log_message("warning: color was not specified, defaulting to \"BLUE\"", Verbosity::ERROR);
431427
}
432-
#if defined(RTI_CONNEXT_MICRO)
433-
if (!publish && color != NULL) {
434-
free(color);
435-
color = NULL;
436-
logger.log_message("warning: content filtered topic not supported, normal topic used", Verbosity::ERROR);
437-
}
438-
if (!publish && take_read_next_instance == true ) {
439-
logger.log_message("warning: use of take/read_next_instance() not supported, using take/read()", Verbosity::ERROR);
440-
}
441-
#endif
442428
if (publish && timebasedfilter_interval_us > 0) {
443429
logger.log_message("warning: time base filter [--time-filter] ignored on publisher applications", Verbosity::ERROR);
444430
}
@@ -472,6 +458,17 @@ class ShapeOptions {
472458
if (!coherent_set_enabled && !ordered_access_enabled && coherent_set_access_scope_set) {
473459
logger.log_message("warning: --access-scope ignored because not coherent, or ordered access enabled", Verbosity::ERROR);
474460
}
461+
#if defined(RTI_CONNEXT_MICRO)
462+
if (!publish && color != NULL) {
463+
free(color);
464+
color = NULL;
465+
logger.log_message("warning: content filtered topic not supported, normal topic used", Verbosity::ERROR);
466+
}
467+
if (!publish && take_read_next_instance == true ) {
468+
take_read_next_instance = false;
469+
logger.log_message("warning: use of take/read_next_instance() not available, using take/read()", Verbosity::ERROR);
470+
}
471+
#endif
475472

476473
return true;
477474
}
@@ -1223,30 +1220,40 @@ class ShapeApplication {
12231220
{
12241221
logger.log_message(" Presentation Access Scope "
12251222
+ QosUtils::to_string(pub_qos.presentation.access_scope)
1226-
+ std::string(" : Not supported"), Verbosity::ERROR);
1223+
+ std::string(" : not supported"), Verbosity::ERROR);
1224+
return false;
12271225
}
12281226
#endif
12291227
#if defined(INTERCOM_DDS)
12301228
if (pub_qos.presentation.coherent_access && pub_qos.presentation.access_scope >= TOPIC_PRESENTATION_QOS)
12311229
{
12321230
logger.log_message(" Coherent Access with Presentation Access Scope "
12331231
+ QosUtils::to_string(pub_qos.presentation.access_scope)
1234-
+ std::string(" : Not supported"), Verbosity::ERROR);
1232+
+ std::string(" : not supported"), Verbosity::ERROR);
1233+
return false;
12351234
}
12361235
#endif
12371236
}
1238-
12391237
logger.log_message(" Presentation Coherent Access = " +
12401238
std::string(pub_qos.presentation.coherent_access ? "true" : "false"), Verbosity::DEBUG);
12411239
logger.log_message(" Presentation Ordered Access = " +
12421240
std::string(pub_qos.presentation.ordered_access ? "true" : "false"), Verbosity::DEBUG);
12431241
logger.log_message(" Presentation Access Scope = " +
12441242
QosUtils::to_string(pub_qos.presentation.access_scope), Verbosity::DEBUG);
1245-
12461243
#else
1247-
logger.log_message(" Presentation Coherent Access = Not supported", Verbosity::ERROR);
1248-
logger.log_message(" Presentation Ordered Access = Not supported", Verbosity::ERROR);
1249-
logger.log_message(" Presentation Access Scope = Not supported", Verbosity::ERROR);
1244+
if (options->coherent_set_enabled) {
1245+
logger.log_message(" Presentation Coherent Access = not supported", Verbosity::ERROR);
1246+
return false;
1247+
}
1248+
if (options->ordered_access_enabled) {
1249+
logger.log_message(" Presentation Ordered Access = not supported", Verbosity::ERROR);
1250+
return false;
1251+
}
1252+
if ((options->coherent_set_enabled || options->ordered_access_enabled)
1253+
&& (options->coherent_set_access_scope != INSTANCE_PRESENTATION_QOS)) {
1254+
logger.log_message(" Presentation Access Scope = not supported", Verbosity::ERROR);
1255+
return false;
1256+
}
12501257
#endif
12511258

12521259
pub = dp->create_publisher(pub_qos, NULL, LISTENER_STATUS_MASK_NONE);
@@ -1259,14 +1266,21 @@ class ShapeApplication {
12591266
pub->get_default_datawriter_qos( dw_qos );
12601267

12611268
#if defined (RTI_CONNEXT_MICRO)
1262-
dw_qos.resource_limits.max_instances = 500;
1263-
dw_qos.resource_limits.max_samples = 500;
1264-
dw_qos.resource_limits.max_samples_per_instance = 500;
1269+
config_dw_qos(dw_qos);
12651270
#endif
12661271

12671272
dw_qos.reliability FIELD_ACCESSOR.kind = options->reliability_kind;
12681273
logger.log_message(" Reliability = " + QosUtils::to_string(dw_qos.reliability FIELD_ACCESSOR.kind), Verbosity::DEBUG);
12691274
dw_qos.durability FIELD_ACCESSOR.kind = options->durability_kind;
1275+
#if defined(RTI_CONNEXT_MICRO)
1276+
if (dw_qos.durability FIELD_ACCESSOR.kind == TRANSIENT_DURABILITY_QOS) {
1277+
logger.log_message(" Durability = TRANSIENT_DURABILITY_QOS : not supported", Verbosity::ERROR);
1278+
return false;
1279+
} else if (dw_qos.durability FIELD_ACCESSOR.kind == PERSISTENT_DURABILITY_QOS) {
1280+
logger.log_message(" Durability = PERSISTENT_DURABILITY_QOS : not supported", Verbosity::ERROR);
1281+
return false;
1282+
}
1283+
#endif
12701284
logger.log_message(" Durability = " + QosUtils::to_string(dw_qos.durability FIELD_ACCESSOR.kind), Verbosity::DEBUG);
12711285

12721286
#if defined(RTI_CONNEXT_DDS) || defined (RTI_CONNEXT_MICRO)
@@ -1327,34 +1341,29 @@ class ShapeApplication {
13271341
dw_qos.history FIELD_ACCESSOR.depth = options->history_depth;
13281342
}
13291343
else if ( options->history_depth == 0 ) {
1330-
//TODO check if KEEP_ALL is supported with micro
1331-
#if defined (RTI_CONNEXT_MICRO)
1332-
dw_qos.history FIELD_ACCESSOR.kind = KEEP_ALL_HISTORY_QOS;
1333-
//dw_qos.history FIELD_ACCESSOR.depth = 500;
1334-
#else
13351344
dw_qos.history FIELD_ACCESSOR.kind = KEEP_ALL_HISTORY_QOS;
1336-
#endif
13371345
}
13381346
logger.log_message(" History = " + QosUtils::to_string(dw_qos.history FIELD_ACCESSOR.kind), Verbosity::DEBUG);
13391347
if (dw_qos.history FIELD_ACCESSOR.kind == KEEP_LAST_HISTORY_QOS){
13401348
logger.log_message(" HistoryDepth = " + std::to_string(dw_qos.history FIELD_ACCESSOR.depth), Verbosity::DEBUG);
13411349
}
13421350

13431351
if (options->lifespan_us > 0) {
1344-
1345-
#if defined(RTI_CONNEXT_DDS) || defined(OPENDDS) || defined(TWINOAKS_COREDX) || defined(INTERCOM_DDS)
1352+
#if defined (RTI_CONNEXT_MICRO)
1353+
logger.log_message(" Lifespan = not supported", Verbosity::ERROR);
1354+
return false;
1355+
#elif defined(RTI_CONNEXT_DDS) || defined(OPENDDS) || defined(TWINOAKS_COREDX) || defined(INTERCOM_DDS)
13461356
dw_qos.lifespan FIELD_ACCESSOR.duration.SECONDS_FIELD_NAME = options->lifespan_us / 1000000;
13471357
dw_qos.lifespan FIELD_ACCESSOR.duration.nanosec = (options->lifespan_us % 1000000) * 1000;
13481358
#elif defined(EPROSIMA_FAST_DDS)
13491359
dw_qos.lifespan FIELD_ACCESSOR.duration = Duration_t(options->lifespan_us * 1e-6);
13501360
#endif
13511361
}
13521362
#if !defined(RTI_CONNEXT_MICRO)
1353-
logger.log_message(" Lifespan = " + std::to_string(dw_qos.lifespan FIELD_ACCESSOR.duration.SECONDS_FIELD_NAME) + " secs", Verbosity::DEBUG);
1354-
logger.log_message(" " + std::to_string(dw_qos.lifespan FIELD_ACCESSOR.duration.nanosec) + " nanosecs", Verbosity::DEBUG);
1355-
1356-
#else
1357-
logger.log_message(" Lifespan = Not supported", Verbosity::ERROR);
1363+
logger.log_message(" Lifespan = " + std::to_string(dw_qos.lifespan FIELD_ACCESSOR.duration.SECONDS_FIELD_NAME) + " secs",
1364+
Verbosity::DEBUG);
1365+
logger.log_message(" " + std::to_string(dw_qos.lifespan FIELD_ACCESSOR.duration.nanosec) + " nanosecs",
1366+
Verbosity::DEBUG);
13581367
#endif
13591368

13601369
#if defined(RTI_CONNEXT_DDS)
@@ -1443,15 +1452,17 @@ class ShapeApplication {
14431452
{
14441453
logger.log_message(" Presentation Access Scope "
14451454
+ QosUtils::to_string(sub_qos.presentation.access_scope)
1446-
+ std::string(" : Not supported"), Verbosity::ERROR);
1455+
+ std::string(" : not supported"), Verbosity::ERROR);
1456+
return false;
14471457
}
14481458
#endif
14491459
#if defined(INTERCOM_DDS)
14501460
if (sub_qos.presentation.coherent_access && sub_qos.presentation.access_scope >= TOPIC_PRESENTATION_QOS)
14511461
{
14521462
logger.log_message(" Coherent Access with Presentation Access Scope "
14531463
+ QosUtils::to_string(sub_qos.presentation.access_scope)
1454-
+ std::string(" : Not supported"), Verbosity::ERROR);
1464+
+ std::string(" : not supported"), Verbosity::ERROR);
1465+
return false;
14551466
}
14561467
#endif
14571468
}
@@ -1464,9 +1475,19 @@ class ShapeApplication {
14641475
QosUtils::to_string(sub_qos.presentation.access_scope), Verbosity::DEBUG);
14651476

14661477
#else
1467-
logger.log_message(" Presentation Coherent Access = Not supported", Verbosity::ERROR);
1468-
logger.log_message(" Presentation Ordered Access = Not supported", Verbosity::ERROR);
1469-
logger.log_message(" Presentation Access Scope = Not supported", Verbosity::ERROR);
1478+
if (options->coherent_set_enabled) {
1479+
logger.log_message(" Presentation Coherent Access = not supported", Verbosity::ERROR);
1480+
return false;
1481+
}
1482+
if (options->ordered_access_enabled) {
1483+
logger.log_message(" Presentation Ordered Access = not supported", Verbosity::ERROR);
1484+
return false;
1485+
}
1486+
if ((options->coherent_set_enabled || options->ordered_access_enabled)
1487+
&& (options->coherent_set_access_scope != INSTANCE_PRESENTATION_QOS)) {
1488+
logger.log_message(" Presentation Access Scope = not supported", Verbosity::ERROR);
1489+
return false;
1490+
}
14701491
#endif
14711492

14721493
sub = dp->create_subscriber( sub_qos, NULL, LISTENER_STATUS_MASK_NONE );
@@ -1480,16 +1501,21 @@ class ShapeApplication {
14801501
sub->get_default_datareader_qos( dr_qos );
14811502

14821503
#if defined (RTI_CONNEXT_MICRO)
1483-
dr_qos.resource_limits.max_instances = 500;
1484-
dr_qos.resource_limits.max_samples = 500;
1485-
dr_qos.resource_limits.max_samples_per_instance = 500;
1486-
dr_qos.reader_resource_limits.max_remote_writers = 2;
1487-
dr_qos.reader_resource_limits.max_samples_per_remote_writer = 500;
1504+
config_dr_qos(dr_qos);
14881505
#endif
14891506

14901507
dr_qos.reliability FIELD_ACCESSOR.kind = options->reliability_kind;
14911508
logger.log_message(" Reliability = " + QosUtils::to_string(dr_qos.reliability FIELD_ACCESSOR.kind), Verbosity::DEBUG);
14921509
dr_qos.durability FIELD_ACCESSOR.kind = options->durability_kind;
1510+
#if defined(RTI_CONNEXT_MICRO)
1511+
if (dr_qos.durability FIELD_ACCESSOR.kind == TRANSIENT_DURABILITY_QOS) {
1512+
logger.log_message(" Durability = TRANSIENT_DURABILITY_QOS : not supported", Verbosity::ERROR);
1513+
return false;
1514+
} else if (dr_qos.durability FIELD_ACCESSOR.kind == PERSISTENT_DURABILITY_QOS) {
1515+
logger.log_message(" Durability = PERSISTENT_DURABILITY_QOS : not supported", Verbosity::ERROR);
1516+
return false;
1517+
}
1518+
#endif
14931519
logger.log_message(" Durability = " + QosUtils::to_string(dr_qos.durability FIELD_ACCESSOR.kind), Verbosity::DEBUG);
14941520

14951521
#if defined(RTI_CONNEXT_DDS) || defined (RTI_CONNEXT_MICRO)
@@ -1530,6 +1556,7 @@ class ShapeApplication {
15301556
if ( options->timebasedfilter_interval_us > 0) {
15311557
#if defined(EPROSIMA_FAST_DDS) || defined(RTI_CONNEXT_MICRO)
15321558
logger.log_message(" TimeBasedFilter = not supported", Verbosity::ERROR);
1559+
return false;
15331560
#else
15341561
dr_qos.time_based_filter FIELD_ACCESSOR.minimum_separation.SECONDS_FIELD_NAME = options->timebasedfilter_interval_us / 1000000;
15351562
dr_qos.time_based_filter FIELD_ACCESSOR.minimum_separation.nanosec = (options->timebasedfilter_interval_us % 1000000) * 1000;

0 commit comments

Comments
 (0)