NordicSemiconductor / zcbor

Low footprint C/C++ CBOR library and Python tool providing code generation from CDDL descriptions.
Apache License 2.0
105 stars 34 forks source link

zcbor_decode.c: Add a function for printing CBOR data #367

Closed oyvindronningstad closed 6 months ago

oyvindronningstad commented 9 months ago

zcbor_diag_print() prints the CBOR data pointed to by the state variable, marked up with color and indentation.

Repurpose zcbor_any_skip() for the traversal. Add a new file zcbor_diag_print.h to hold new helper functions.

Add test for printing function.

Add info about the function to the README.

To see the README additions rendered: https://github.com/oyvindronningstad/zcbor/tree/diag#diagnostic-printing-of-cbor-data

oyvindronningstad commented 6 months ago

Now depends on #373

oyvindronningstad commented 6 months ago

Exploring other solutions, closing for now.