Skip to content

mbus_parse_hex -n ignores parsing problem #169

@fredrik-sk

Description

@fredrik-sk

PR #168 executes the code for normalized output, which probably has not been executed so much until now.

As found here #168 (comment)
running mbus_hex_parse -n sen_pollutherm.hex causes some errors to be printed but the program returns with exitcode 0.

Adding an else statment like this

--- a/mbus/mbus-protocol-aux.c
+++ b/mbus/mbus-protocol-aux.c
@@ -1455,6 +1455,8 @@ mbus_data_variable_xml_normalized(mbus_data_variable *data)
             }
             else
             {
+                free(buff);
+                return NULL;
             }

             len += snprintf(&buff[len], buff_size - len, "    </DataRecord>\n\n");

makes the test output this:

mbus_vif_unit_normalize: Unknown VIF 0x07B
mbus_vib_unit_normalize: Error mbus_vif_unit_normalize
mbus_parse_variable_record: problem with mbus_vib_unit_normalize
Failed to generate XML representation of MBUS frame:
Unable to generate XML for test/test-frames/sen_pollutherm.hex

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions