OpenCyphal / yakut

Simple CLI tool for diagnostics and debugging of Cyphal networks
https://opencyphal.org
MIT License
49 stars 10 forks source link

JSON output format does not support byte strings #56

Open pavel-kirienko opened 2 years ago

pavel-kirienko commented 2 years ago
image
pavel-kirienko commented 2 years ago

Solution 1

Modify the exploder/unexploder to convert bytes to/from hex strings.

https://github.com/OpenCyphal/yakut/blob/996e64668d8902bd876fab16b64e3361094a674d/yakut/register.py#L71-L144

Solution 2

Modify the unexploder to accept hex strings for unstructured-typed register values. Modify the JSON encoder to convert bytes to hex strings. This approach will keep the YAML output unchanged.