Open aangert opened 6 months ago
That's the current way "any" works. Representing a decoded "any" object in code is complex so this hasn't been done yet. There's some work looking into this, so I will update here when that is merged.
In a pinch you can use a union with all the possible types.
When generating code with
zcbor code -c pet.cddl -d -e -t Pet --output-cmake ~/generated/pet
any element of typeany
orcbor-any
is ignored and missing in the generated struct. zcbor doesn't generate a warning about thispet.cddl:
pet_types.h: