diff --git a/python/test/test_novatel_types.py b/python/test/test_novatel_types.py index ffc823766..b1b6fe3c4 100644 --- a/python/test/test_novatel_types.py +++ b/python/test/test_novatel_types.py @@ -152,7 +152,6 @@ def test_ASCII_UCHAR_BYTE_INVALID(helper): assert intermediate_format.INT_1 == 0 -@pytest.mark.xfail(reason="%c is broken") def test_ASCII_CHAR_VALID(helper): helper.create_base_field("CHAR_1", FIELD_TYPE.SIMPLE, "%c", 1, DATA_TYPE.CHAR) helper.create_base_field("CHAR_2", FIELD_TYPE.SIMPLE, "%c", 1, DATA_TYPE.CHAR) @@ -167,7 +166,6 @@ def test_ASCII_CHAR_VALID(helper): assert intermediate_format.CHAR_3 == ord(';') -@pytest.mark.xfail(reason="%c is broken") def test_ASCII_CHAR_INVALID(helper): helper.create_base_field("CHAR", FIELD_TYPE.SIMPLE, "%c", 2, DATA_TYPE.CHAR) input = b"" diff --git a/regression/targets/BESTUTMBIN.GPS.ABBREV_ASCII b/regression/targets/BESTUTMBIN.GPS.ABBREV_ASCII index df391a966..048be2054 100644 Binary files a/regression/targets/BESTUTMBIN.GPS.ABBREV_ASCII and b/regression/targets/BESTUTMBIN.GPS.ABBREV_ASCII differ diff --git a/regression/targets/BESTUTMBIN.GPS.ASCII b/regression/targets/BESTUTMBIN.GPS.ASCII index 4081a22fc..3d295b877 100644 Binary files a/regression/targets/BESTUTMBIN.GPS.ASCII and b/regression/targets/BESTUTMBIN.GPS.ASCII differ diff --git a/regression/targets/BESTUTMBIN.GPS.BINARY b/regression/targets/BESTUTMBIN.GPS.BINARY index 3856b74a1..4d6188967 100644 Binary files a/regression/targets/BESTUTMBIN.GPS.BINARY and b/regression/targets/BESTUTMBIN.GPS.BINARY differ diff --git a/regression/targets/BESTUTMBIN.GPS.FLATTENED_BINARY b/regression/targets/BESTUTMBIN.GPS.FLATTENED_BINARY index 7a59573cd..850735215 100644 Binary files a/regression/targets/BESTUTMBIN.GPS.FLATTENED_BINARY and b/regression/targets/BESTUTMBIN.GPS.FLATTENED_BINARY differ diff --git a/regression/targets/BESTUTMBIN.GPS.JSON b/regression/targets/BESTUTMBIN.GPS.JSON index a8dca6a01..8e379b5d3 100644 Binary files a/regression/targets/BESTUTMBIN.GPS.JSON and b/regression/targets/BESTUTMBIN.GPS.JSON differ diff --git a/src/decoders/oem/src/message_decoder.cpp b/src/decoders/oem/src/message_decoder.cpp index 3bd13980e..db53411aa 100644 --- a/src/decoders/oem/src/message_decoder.cpp +++ b/src/decoders/oem/src/message_decoder.cpp @@ -44,7 +44,13 @@ void MessageDecoder::InitOemFieldMaps() // ========================================================= // ASCII Field Mapping // ========================================================= - asciiFieldMap[CalculateBlockCrc32("c")] = SimpleAsciiMapEntry(); + asciiFieldMap[CalculateBlockCrc32("c")] = [](std::vector& vIntermediateFormat_, BaseField::ConstPtr pstMessageDataType_, + const char** ppcToken_, [[maybe_unused]] const size_t tokenLength_, + [[maybe_unused]] JsonReader& pclMsgDb_) { + // TODO: check that the character is printable + // if (!isprint(**ppcToken_)) { throw ... } + vIntermediateFormat_.emplace_back(static_cast(**ppcToken_), pstMessageDataType_); + }; asciiFieldMap[CalculateBlockCrc32("k")] = SimpleAsciiMapEntry(); asciiFieldMap[CalculateBlockCrc32("lk")] = SimpleAsciiMapEntry();