Skip to content

Commit 1afc392

Browse files
committed
Disabled logging for Micro messages as they print a NUL char and fixed some small issues
1 parent 83e9312 commit 1afc392

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

generate_xlsx_report.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#################################################################
1010

1111
import argparse
12-
from io import BytesIO
1312
import junitparser
1413
import lxml
1514
import pathlib
@@ -169,11 +168,9 @@ def __init__(self, input: pathlib.Path):
169168
@staticmethod
170169
def xml_parser(file):
171170
"""Function to parse the XML file"""
172-
# Remove null bytes from the file
173-
with open(file, "rb") as f:
174-
data = f.read().replace(b"\x00", b"")
171+
175172
parser = lxml.etree.XMLParser(huge_tree=True)
176-
return lxml.etree.parse(BytesIO(data), parser)
173+
return lxml.etree.parse(file, parser)
177174

178175
def update_value_aggregated_data_dict(self,
179176
dictionary: dict,

srcCxx/shape_configurator_rti_connext_micro.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ static void config_micro()
8181
{
8282
RT::Registry *registry = NULL;
8383

84+
OSAPI_Log_set_verbosity(OSAPI_LOG_VERBOSITY_SILENT);
85+
8486
registry = DDSTheParticipantFactory->get_registry();
8587

8688
/* Register Writer History */

srcCxx/shape_main.cxx

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,27 +1519,32 @@ class ShapeApplication {
15191519
#if defined(EPROSIMA_FAST_DDS)
15201520
logger.log_message(" DataRepresentation = " + QosUtils::to_string(dr_qos.representation().m_value[0]), Verbosity::DEBUG);
15211521
#else
1522-
logger.log_message(" DataRepresentation = " + QosUtils::to_string(dr_qos.representation FIELD_ACCESSOR.value[0]), Verbosity::DEBUG);
1522+
logger.log_message(" DataRepresentation = " + QosUtils::to_string(dr_qos.representation FIELD_ACCESSOR.value[0]), Verbosity::DEBUG);
15231523
#endif
15241524
if ( options->ownership_strength != -1 ) {
15251525
dr_qos.ownership FIELD_ACCESSOR.kind = EXCLUSIVE_OWNERSHIP_QOS;
15261526
}
15271527
logger.log_message(" Ownership = " + QosUtils::to_string(dr_qos.ownership FIELD_ACCESSOR.kind), Verbosity::DEBUG);
1528+
1529+
15281530
if ( options->timebasedfilter_interval_us > 0) {
15291531
#if defined(EPROSIMA_FAST_DDS) || defined(RTI_CONNEXT_MICRO)
15301532
logger.log_message(" TimeBasedFilter = not supported", Verbosity::ERROR);
15311533
#else
15321534
dr_qos.time_based_filter FIELD_ACCESSOR.minimum_separation.SECONDS_FIELD_NAME = options->timebasedfilter_interval_us / 1000000;
15331535
dr_qos.time_based_filter FIELD_ACCESSOR.minimum_separation.nanosec = (options->timebasedfilter_interval_us % 1000000) * 1000;
1534-
1535-
logger.log_message(" TimeBasedFilter = " +
1536-
std::to_string(dr_qos.time_based_filter FIELD_ACCESSOR.minimum_separation.SECONDS_FIELD_NAME) + "secs",
1537-
Verbosity::DEBUG);
1538-
logger.log_message(" " +
1539-
std::to_string(dr_qos.time_based_filter FIELD_ACCESSOR.minimum_separation.nanosec) + "nanosecs",
1540-
Verbosity::DEBUG);
15411536
#endif
15421537
}
1538+
1539+
#if !defined(EPROSIMA_FAST_DDS) && !defined(RTI_CONNEXT_MICRO)
1540+
logger.log_message(" TimeBasedFilter = " +
1541+
std::to_string(dr_qos.time_based_filter FIELD_ACCESSOR.minimum_separation.SECONDS_FIELD_NAME) + "secs",
1542+
Verbosity::DEBUG);
1543+
logger.log_message(" " +
1544+
std::to_string(dr_qos.time_based_filter FIELD_ACCESSOR.minimum_separation.nanosec) + "nanosecs",
1545+
Verbosity::DEBUG);
1546+
#endif
1547+
15431548
if ( options->deadline_interval_us > 0 ) {
15441549
dr_qos.deadline FIELD_ACCESSOR.period.SECONDS_FIELD_NAME = options->deadline_interval_us / 1000000;
15451550
dr_qos.deadline FIELD_ACCESSOR.period.nanosec = (options->deadline_interval_us % 1000000) * 1000;;
@@ -1730,10 +1735,10 @@ class ShapeApplication {
17301735
logger.log_message("Calling take() function", Verbosity::DEBUG);
17311736
retval = drs[i]->take ( samples,
17321737
sample_infos,
1733-
DDS_LENGTH_UNLIMITED,
1734-
DDS_ANY_SAMPLE_STATE,
1735-
DDS_ANY_VIEW_STATE,
1736-
DDS_ANY_INSTANCE_STATE );
1738+
LENGTH_UNLIMITED,
1739+
ANY_SAMPLE_STATE,
1740+
ANY_VIEW_STATE,
1741+
ANY_INSTANCE_STATE );
17371742
if (retval == DDS_RETCODE_OK) {
17381743
logger.log_message("Taken " + std::to_string(samples.length())
17391744
+ " sample(s)", Verbosity::DEBUG);
@@ -1813,7 +1818,8 @@ class ShapeApplication {
18131818
#if defined(EPROSIMA_FAST_DDS)
18141819
shape_key.color FIELD_ACCESSOR = instance_handle_color[sample_info->instance_handle] NAME_ACCESSOR;
18151820
#elif defined(RTI_CONNEXT_MICRO)
1816-
strncpy(shape_key.color, instance_handle_color[sample_info->instance_handle].c_str(), sizeof(shape_key.color));
1821+
// 128 is the max length of the color string
1822+
strncpy(shape_key.color, instance_handle_color[sample_info->instance_handle].c_str(), 128);
18171823
#else
18181824
drs[i]->get_key_value(shape_key, sample_info->instance_handle);
18191825
#endif

0 commit comments

Comments
 (0)