Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed

Conversation

oyvindronningstad
Copy link
Collaborator

@oyvindronningstad oyvindronningstad commented Sep 28, 2023

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

include/zcbor_decode.h Show resolved Hide resolved
include/zcbor_diag_print.h Outdated Show resolved Hide resolved
include/zcbor_diag_print.h Outdated Show resolved Hide resolved
src/zcbor_decode.c Show resolved Hide resolved
src/zcbor_decode.c Outdated Show resolved Hide resolved
tests/decode/test2_suit/CMakeLists.txt Outdated Show resolved Hide resolved
tests/unit/test4_diag_print/prj.conf Outdated Show resolved Hide resolved
@oyvindronningstad oyvindronningstad force-pushed the diag branch 3 times, most recently from cfc0db0 to ce1b648 Compare October 2, 2023 12:27
include/zcbor_diag_print.h Outdated Show resolved Hide resolved
@oyvindronningstad oyvindronningstad force-pushed the diag branch 3 times, most recently from 133da91 to 9e31675 Compare December 11, 2023 14:31
@oyvindronningstad
Copy link
Collaborator Author

Now depends on #373

@oyvindronningstad oyvindronningstad force-pushed the diag branch 2 times, most recently from 3713890 to 078dc89 Compare December 11, 2023 14:37
zcbor_print_cbor() prints the CBOR data pointed to by the state
variable, marked up with color and indentation.

Repurpose zcbor_any_skip() for the traversal.
Add helper functions to zcbor_print.h.

Add test for printing function.

Add info about the function to the README.

Signed-off-by: Øyvind Rønningstad <[email protected]>
@oyvindronningstad
Copy link
Collaborator Author

Exploring other solutions, closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants