diff --git a/src/lib/ebus/data.cpp b/src/lib/ebus/data.cpp index 14a10cf7..5bdb3846 100644 --- a/src/lib/ebus/data.cpp +++ b/src/lib/ebus/data.cpp @@ -927,13 +927,16 @@ result_t ConstantDataField::readSymbols(const SymbolString& input, size_t offset if (result != RESULT_OK) { return result; } - if (m_verify) { string value = coutput.str(); FileReader::trim(&value); + if (m_verify) { if (value != m_value) { return RESULT_ERR_OUT_OF_RANGE; } } + if (outputFormat & OF_JSON) { + *output << value; + } return RESULT_OK; } diff --git a/src/lib/ebus/test/test_data.cpp b/src/lib/ebus/test/test_data.cpp index 1c09989d..1cfb5626 100755 --- a/src/lib/ebus/test/test_data.cpp +++ b/src/lib/ebus/test/test_data.cpp @@ -118,6 +118,8 @@ int main() { {"x,,str:10,==dummy", "", "10fe07000a48616c6c6f2044752120", "00", "rW"}, {"x,,str:10,=dummy", "", "10fe07000a64756d6d792020202020", "00", ""}, {"x,,str:10,==dummy", "", "10fe07000a64756d6d792020202020", "00", ""}, + {",,str:5,=dummy", "\n \"0\": {\"name\": \"\", \"value\": \"dummy\"}", "10fe07000a64756d6d792020202020", "00", "j"}, + {",,str:5,==\"dummy\"","\n \"0\": {\"name\": \"\", \"value\": \"dummy\"}", "10fe07000a64756d6d792020202020", "00", "j"}, {"x,,nts:10", "Hallo, Du!", "10fe07000a48616c6c6f2c20447521", "00", ""}, {"x,,nts:10", "Hallo, Du!", "10fe07000a48616c6c6f2c20447521", "00", ""}, {"x,,nts:10", "Hallo, Du", "10fe07000a48616c6c6f2c20447500", "00", ""},