1# zcbor v. 0.9.1 (2024-10-17)
2
3Any new bugs, requests, or missing features should be reported as [Github issues](https://github.com/NordicSemiconductor/zcbor/issues).
4
5## Improvements:
6
7 * README improvements:
8   * pypi_README.md: Add separate README for use in the pypi package
9   * README: Clarify what ZCBOR_STOP_ON_ERROR does
10   * RELEASE_NOTES.md: Move "Unsupported CDDL features" to the README
11
12## Bugfixes:
13
14## Unsupported CDDL features
15
16This section has been moved to the README, and this heading will be removed in subsequent releases.
17
18
19# zcbor v. 0.9.0 (2024-08-27)
20
21Any new bugs, requests, or missing features should be reported as [Github issues](https://github.com/NordicSemiconductor/zcbor/issues).
22
23## Improvements:
24
25 * zcbor.py:
26   * Allow --file-header to accept a path to a file with header contents
27   * Avoid generated names that are C keywords (capitalize them if present)
28   * Whenever generated code uses function pointers, add dummy calls using the function pointers, to verify that the arguments have the right type.
29   * Optimize range checks
30   * Convert function docs in comments to pep-257 docstrings and add some new docstrings
31 * C libraries:
32   * Remove zcbor_simple_*() functions from the header file to discourage their use.
33   * zcbor_decode: Allow deciding at run-time whether to enforce canonical data (via 'enforce_canonical'), instead of via ZCBOR_CANONICAL.
34   * zcbor_print.h: Move function implementations into new file zcbor_print.c
35 * Documentation:
36   * MIGRATION_GUIDE.md: Add a migration guide file
37   * README.md: Clarification on n_flags
38   * ARCHITECTURE.md: Small improvements to bring the document up to date
39
40## Bugfixes:
41
42 * zcbor.py:
43   * Fixes to support code generation on Windows
44   * Handle when files are on different drives in Windows
45   * Fix a few bugs in code generation to do with dereferencing
46   * Fix bug where NINT literals were not given unique names
47   * Fix a bug where empty groups and lists would give an error
48   * Fix bstr names based on size
49   * Don't omit zcbor_union_elem_code() when there is a range check.
50   * Fix bug where paths to generated files could not be absolute
51   * Fix a bug where some decoding function were not called
52   * Fix/improve deeply nested types
53   * Remove outdated assert statement that caused incorrect assert
54   * Fix a bug in CDDL parsing to do with nested brackets
55 * zcbor_decode:
56   * Fix various things related to constant_state
57   * Fix a bug with enforce_canonical (ZCBOR_CANONICAL) and floats
58 * zcbor_encode.c: Fix a length bug in zcbor_bstr_end_decode()
59 * zcbor_tags.h: Typo fix YANK -> YANG
60
61## Unsupported CDDL features
62Not all features outlined in the CDDL specs [RFC8610](https://datatracker.ietf.org/doc/html/rfc8610), [RFC9090](https://datatracker.ietf.org/doc/html/rfc9090), and [RFC9165](https://datatracker.ietf.org/doc/html/rfc9165) are supported by zcbor.
63The following is a list of limitations and missing features:
64
65 * Generated code does not support unordered maps.
66 * Using `&()` to turn groups into choices (unions). `&()` is supported when used with `.bits`.
67 * Representation Types (`#x.y`), except for tags (`#6.y(foo)`) which are supported.
68 * Unwrapping (`~`)
69 * The control operators `.regexp`, `.ne`, `.default`, and `.within` from RFC8610.
70 * The control operators `.sdnv`, `.sdnvseq`, and `.oid` from RFC9090.
71 * The control operators `.plus`, `.cat`, `.det`, `.abnf`, `.abnfb`, and `.feature` from RFC9165.
72 * Generics (`foo<a, b>`).
73 * Using `:` for map keys.
74 * Cuts, either via `^` or implicitly via `:`.
75 * Most of the "Extended Diagnostic Notation" is unsupported.
76
77
78# zcbor v. 0.8.1 (2024-01-26)
79
80Any new bugs, requests, or missing features should be reported as [Github issues](https://github.com/NordicSemiconductor/zcbor/issues).
81
82See also the [release notes for 0.8.0](#zcbor-v-080-2024-01-09) below.
83
84## Improvements:
85
86 * zcbor.py: Use zcbor_uint_decode() when decoding only positive enums
87 * zcbor_common.h: Add ZCBOR_VERSION macro
88
89## Bugfixes:
90
91 * zcbor_common.h: Add forward declaration for strnlen()
92 * zcbor.py: Fix conversion of UINT8_MAX to avoid script errors when using e.g. 255 in CDDL
93 * zcbor_print.h: Fix iterator type and print formats to avoid compiler warnings
94
95## Unsupported CDDL features
96Not all features outlined in the CDDL specs [RFC8610](https://datatracker.ietf.org/doc/html/rfc8610), [RFC9090](https://datatracker.ietf.org/doc/html/rfc9090), and [RFC9165](https://datatracker.ietf.org/doc/html/rfc9165) are supported by zcbor.
97The following is a list of limitations and missing features:
98
99 * Using `&()` to turn groups into choices (unions). `&()` is supported when used with `.bits`.
100 * Representation Types (`#x.y`), except for tags (`#6.y(foo)`) which are supported.
101 * Unwrapping (`~`)
102 * The control operators `.regexp`, `.ne`, `.default`, and `.within` from RFC8610.
103 * The control operators `.sdnv`, `.sdnvseq`, and `.oid` from RFC9090.
104 * The control operators `.plus`, `.cat`, `.det`, `.abnf`, `.abnfb`, and `.feature` from RFC9165.
105 * Generics (`foo<a, b>`).
106 * Using `:` for map keys.
107 * Cuts, either via `^` or implicitly via `:`.
108 * Most of the "Extended Diagnostic Notation" is unsupported.
109
110
111# zcbor v. 0.8.0 (2024-01-09)
112
113Any new bugs, requests, or missing features should be reported as [Github issues](https://github.com/NordicSemiconductor/zcbor/issues).
114
115## Improvements:
116 * C library: Add support for searching for elements in a map.
117 * Overhaul zcbor logging/printing
118   * Refactor printing of errors from generated functions
119   * zcbor_print.h: Improve zcbor_trace() and other tracing
120   * zcbor_print.h: Move from printk to printf
121   * Rename zcbor_print() to zcbor_log()
122   * zcbor_print.h: Move printing code to a new file zcbor_print.h
123   * zcbor_debug.h: Add function for getting error string and printing it
124 * Performance improvements
125   * zcbor.py: Refactor the regex matching to fix label and remove all_types_regex
126   * zcbor.py: Merge regexes for pure types without values
127   * zcbor.py: Add a cache for compiled regex patterns
128   * zcbor.py: Don't regenerate the big list of regexes every call
129   * zcbor_encode: Simplify value_encode() by using the new zcbor_header_len
130   * zcbor_decode.c: Streamline value_extract
131   * zcbor_common: Refactor zcbor_header_len
132   * zcbor.py: Don't use zcbor_present_encode()
133   * zcbor_common: Add a zcbor_entry_function helper
134 * Code generation name improvements:
135   * zcbor.py: Make generated variable names C-compatible.
136   * zcbor.py: Change name of generated choice enum members to add a '_c'
137   * Avoid leading and trailing as well as repeated underscores
138 * API cleanup/improvements:
139   * include: Rearrange and improve zcbor_decode.h and zcbor_encode.h
140   * zcbor_encode: Change zcbor_tag_encode to take a pointer argument
141   * zcbor_common: Rename ZCBOR_FLAG_TRANSFER_PAYLOAD to ZCBOR_FLAG_KEEP_PAYLOAD
142   * zcbor_decode: Add _pexpect() functions
143 * Internal cleanup:
144   * zcbor_encode, zcbor_decode: Move inline functions from header files
145   * zcbor_decode.c: Move MAJOR_TYPE() and ADDITIONAL() macros to zcbor_common.h
146   * src: Abstract float16 conversion and move it to zcbor_common.c
147   * zcbor_common: Add ZCBOR_FLAG_KEEP_DECODE_STATE to zcbor_process_backup()
148   * Move zcbor_array_at_end() from zcbor_common to zcbor_decode
149 * Move from setup.py to pyproject.toml for creation of zcbor packages
150 * zcbor_decode: Add validation that data follows canonical CBOR rules
151 * zcbor.py: Change the label regex to accept non-latin characters
152 * C library: Change usage of strlen to use strnlen
153
154## Bugfixes:
155 * zcbor.py: Fix range_checks for 'OTHER' type
156 * zcbor_decode.c: Fix "'num_decode' may be used uninitialized"
157 * zcbor.py: Generate cmake files with linux paths on Windows
158 * Remove references to uint_fast32_t
159 * Use ZCBOR_BIG_ENDIAN instead of CONFIG_BIG_ENDIAN
160 * zcbor.py: Fix cborhex generation so it generates newlines instead of spaces
161 * zcbor.py: Adjust the lower bound on negative numbers.
162 * zcbor_encode, zcbor_decode: fix double promotion warnings
163 * zcbor_print.h: Add missing errors to zcbor_error_str()
164 * zcbor_print.h: Fix memcmp expression
165 * zcbor.py: DataTranslator: fix type checking
166
167## Unsupported CDDL features
168Not all features outlined in the CDDL specs [RFC8610](https://datatracker.ietf.org/doc/html/rfc8610), [RFC9090](https://datatracker.ietf.org/doc/html/rfc9090), and [RFC9165](https://datatracker.ietf.org/doc/html/rfc9165) are supported by zcbor.
169The following is a list of limitations and missing features:
170
171 * Using `&()` to turn groups into choices (unions). `&()` is supported when used with `.bits`.
172 * Representation Types (`#x.y`), except for tags (`#6.y(foo)`) which are supported.
173 * Unwrapping (`~`)
174 * The control operators `.regexp`, `.ne`, `.default`, and `.within` from RFC8610.
175 * The control operators `.sdnv`, `.sdnvseq`, and `.oid` from RFC9090.
176 * The control operators `.plus`, `.cat`, `.det`, `.abnf`, `.abnfb`, and `.feature` from RFC9165.
177 * Generics (`foo<a, b>`).
178 * Using `:` for map keys.
179 * Cuts, either via `^` or implicitly via `:`.
180 * Most of the "Extended Diagnostic Notation" is unsupported.
181
182
183# zcbor v. 0.7.0 (2023-04-01)
184
185Any new bugs, requests, or missing features should be reported as [Github issues](https://github.com/NordicSemiconductor/zcbor/issues).
186
187## Improvements:
188
189### Code generation
190 * Add support for float16 encoding and decoding
191 * Add support for C++ in generated code
192 * Use (U)INT(8|16|32|64)_(MIN|MAX) macros in generated code
193 * Add the --c-code-columns option for adding newlines to c_code
194 * Refactor CBOR <-> YAML/JSON translation
195 * Allow adding file headers to generated files, e.g. for copyright.
196
197### C libraries
198 * Add support for float16 encoding and decoding
199 * Add helper functions zcbor_compare_strings() and zcbor_header_len()
200 * Rename prim/primitive to simple
201 * Add new APIs zcbor_uint_(encode/decode)
202 * Move tags enum into separate file zcbor_tags.h and add more tags from the IANA list
203 * When generating cmake files, make all paths relative to the cmake file.
204 * Use the zcbor_compare_strings() function in str_expect()
205 * Make the zcbor source files compile with -Wall and -Wconversion
206 * Refactor zcbor_any_skip()
207 * Change all uint_fast32_t usage to use size_t instead
208
209### Other
210 * README: Improve docs, particularly to help new users
211 * Add two samples: a hello world with no code generation, and one with code generation and script usage
212 * Port decode/encode/unit tests to new ztest API
213 * Fix fuzz tests
214
215## Bugfixes:
216 * zcbor.py: Fix 'zcbor --version' so it works again
217 * zcbor.py: Fix cbor bstrs so they properly check unambiguous values
218 * zcbor.py: Fix rendering of entry functions when they have no output
219 * zcbor.py: Don't flag cbor bstrs as unambiguous
220
221## Unsupported CDDL features
222Not all features outlined in the CDDL specs [RFC8610](https://datatracker.ietf.org/doc/html/rfc8610), [RFC9090](https://datatracker.ietf.org/doc/html/rfc9090), and [RFC9165](https://datatracker.ietf.org/doc/html/rfc9165) are supported by zcbor.
223The following is a list of limitations and missing features:
224
225 * Map elements in data must appear in the same order as they appear in the CDDL.
226 * C API doesn't support searching through a map.
227 * Using `&()` to turn groups into choices (unions). `&()` is supported when used with `.bits`.
228 * Representation Types (`#x.y`), except for tags (`#6.y(foo)`) which are supported.
229 * Unwrapping (`~`)
230 * The control operators `.regexp`, `.ne`, `.default`, and `.within` from RFC8610.
231 * The control operators `.sdnv`, `.sdnvseq`, and `.oid` from RFC9090.
232 * The control operators `.plus`, `.cat`, `.det`, `.abnf`, `.abnfb`, and `.feature` from RFC9165.
233 * Generics (`foo<a, b>`).
234 * Using `:` for map keys.
235 * Cuts, either via `^` or implicitly via `:`.
236 * Most of the "Extended Diagnostic Notation" is unsupported.
237
238
239# zcbor v. 0.6.0 (2022-10-12)
240
241Any new bugs, requests, or missing features should be reported as [Github issues](https://github.com/NordicSemiconductor/zcbor/issues).
242
243## Improvements:
244 * Refactor zcbor CLI to add 'verify' and put all options after keyword
245 * Make several C++ related improvements in the C library
246 * Fix Coverity warnings in C library and generated code
247 * zcbor_decode: Add zcbor_int[32|64]_expect_union
248 * zcbor_common.h: Add new zcbor_assert_state() macro
249 * zcbor_common.h: Rename ARRAY_SIZE to ZCBOR_ARRAY_SIZE to avoid #include order problems in Zephyr
250 * .github: Refactor Github action and add QEMU testing on mps2_an521 (ARM) and qemu_malta_be (MIPS, big-endian)
251 * zcbor.py: Raise argparse error on insufficient --output-* args
252 * zcbor_decode.h: Define variables to avoid rvalue address errors
253 * Add release dates to all RELEASE_NOTES entries
254
255## Bugfixes:
256 * zcbor.py: Fix bug where the union_int optimization decodes twice
257 * zcbor_encode.c: Fix error for big-endian architectures
258
259## Unsupported CDDL features
260Not all features outlined in the [CDDL spec](https://datatracker.ietf.org/doc/html/rfc8610) are supported by zcbor.
261The following is a list of limitations and missing features:
262
263 * Map elements in data must appear in the same order as they appear in the CDDL.
264 * C API doesn't support searching through a map.
265 * 16-bit floating point numbers (float16).
266 * Using `&()` to turn groups into choices (unions). `&()` is supported when used with `.bits`.
267 * Representation Types (`#x.y`), except for tags (`#6.y(foo)`) which are supported.
268 * Unwrapping (`~`)
269 * The control operator `.regexp`.
270 * The control operator `.ne`.
271 * The control operator `.default`.
272 * Generics (`foo<a, b>`).
273 * Most of the "Extended Diagnostic Notation" is unsupported.
274
275
276# zcbor v. 0.5.1 (2022-06-21)
277
278Any new bugs, requests, or missing features should be reported as [Github issues](https://github.com/NordicSemiconductor/zcbor/issues).
279
280## Improvements:
281 * requirements.txt: Change PyYAML requirement from >6.0.0 to >5.4.1 to be more widely compatible.
282 * zcbor_encode/zcbor_decode: Add new functions zcbor_int_encode() and zcbor_int_decode() which accept the integer size as an argument.
283 * zcbor.py: Use zcbor_int_encode() and zcbor_int_decode() when operating directly on _choice enums, since enums can be any size, depending on compiler and project. This removes the restrictions that enums must be 32 bits.
284
285## Bugfixes:
286 * tests: Fix an error in manifest3.cddl (encode/test1) (naming collision with 'uri')
287
288## Unsupported CDDL features
289Not all features outlined in the [CDDL spec](https://datatracker.ietf.org/doc/html/rfc8610) are supported by zcbor.
290The following is a list of limitations and missing features:
291
292 * Map elements in data must appear in the same order as they appear in the CDDL.
293 * C API doesn't support searching through a map.
294 * 16-bit floating point numbers (float16).
295 * Using `&()` to turn groups into choices (unions). `&()` is supported when used with `.bits`.
296 * Representation Types (`#x.y`), except for tags (`#6.y(foo)`) which are supported.
297 * Unwrapping (`~`)
298 * The control operator `.regexp`.
299 * The control operator `.ne`.
300 * The control operator `.default`.
301 * Generics (`foo<a, b>`).
302 * Most of the "Extended Diagnostic Notation" is unsupported.
303
304
305# zcbor v. 0.5.0 (2022-06-13)
306
307Any new bugs, requests, or missing features should be reported as [Github issues](https://github.com/NordicSemiconductor/zcbor/issues).
308
309## Improvements:
310
311### Code generation
312 * Add the --short-names option when generating code, which shortens names in struct definitions.
313 * Allow --default-max-qty to accept a string label when generating code so that the value can be configured after generation.
314 * Update versions of dependencies in pip requirements.
315
316### C Libraries
317 * Add const to *ptr argument of cbor_tstr_encode_ptr.
318 * Make it easier to initialize zcbor_state_t objects: Allow single states as input to zcbor_new_state() and remove return value.
319 * Make zcbor_list/map_end_encode() more robust to wrong max_num arguments (when ZCBOR_CANONICAL is enabled).
320 * Add zcbor_peek_error() for reading the error value without clearing it.
321 * Add zcbor_size_put/encode/decode/expect functions, to allow directly encoding and decoding size_t type variables.
322
323### Tests
324 * Test on multiple Python versions
325 * Add tests for using ranges (< or >) with floats in code generation.
326 * Add/enable test for signature check of SUIT manifests.
327
328
329## Bugfixes:
330 * zcbor.py: Fix missing size check for repeated bstrs with their own type
331 * zcbor_encode.c: Fix encoding of floats equal to 0.0 (or any with leading 0s)
332 * zcbor_encode.h: Fix "taking address of rvalue" errors with some compiler configurations, stemming from zcbor_b|tstr_encode_ptr()
333 * zcbor.py: Add forward declarations to functions in generated code.
334 * zcbor.py: Fix bug when adding tagged (#6.x) items to larger types, e.g. lists.
335 * zcbor.py: Fix naming bug for container types with no members.
336 * zcbor.py: "union_int" optimization: If all union members start with an integer, the optimization does a single int_decode() and identifies the correct union member by the result.
337   * zcbor.py: Fix a bug preventing the "union_int" optimization from being applied.
338   * zcbor.py: Expand the "union_uint" optimization to work on all integers, instead of only positive integers.
339
340
341## Unsupported CDDL features
342Not all features outlined in the [CDDL spec](https://datatracker.ietf.org/doc/html/rfc8610) are supported by zcbor.
343The following is a list of limitations and missing features:
344
345 * Map elements in data must appear in the same order as they appear in the CDDL.
346 * C API doesn't support searching through a map.
347 * 16-bit floating point numbers (float16).
348 * Using `&()` to turn groups into choices (unions). `&()` is supported when used with `.bits`.
349 * Representation Types (`#x.y`), except for tags (`#6.y(foo)`) which are supported.
350 * Unwrapping (`~`)
351 * The control operator `.regexp`.
352 * The control operator `.ne`.
353 * The control operator `.default`.
354 * Generics (`foo<a, b>`).
355 * Most of the "Extended Diagnostic Notation" is unsupported.
356
357
358# zcbor v. 0.4.0 (2022-03-31)
359
360**cddl-gen has been renamed to zcbor!**
361
362Any new bugs, requests, or missing features should be reported as [Github issues](https://github.com/NordicSemiconductor/zcbor/issues).
363
364## Improvements:
365
366### CDDL language
367 * Add support for 32-bit and 64-bit floating point numbers.
368 * Add support for `undefined` in CDDL.
369 * Add the CDDL prelude (from RFC 8610 Appendix D) to all builds (unless excluded with `--no-prelude`)
370 * Add support for more complex `.cbor` and `.cborseq` expressions.
371
372
373### Command line and Python module
374 * Rename script/module to zcbor.
375 * Better 64-bit support:
376   * New argument: `--default-bit-size` which controls the assumed size of integers. See zcbor code `--help` for more information.
377 * Add the `--include-prefix` option for path prefix to generated h files.
378 * Allow using both `--encode` and `--decode` together to generate both at the same time.
379 * Make changes to generated code to build with `-Wpedantic` and `-Wconversion`.
380
381
382### C Libraries
383 * All public function names have been prefixed with `zcbor_`.
384 * Many function names have also been changed slightly.
385 * Better API docs.
386 * Add error value to state, which is populated when a function fails (returns `false`).
387   * Add a `stop_on_error` feature that makes functions abort when an error has occurred (to avoid checking the output of all functions).
388 * Add support for 32-bit and 64-bit floating point numbers.
389 * Better 64-bit support:
390   * New 64-bit integer decoding and encoding functions (in addition to existing 32-bit functions).
391   * `uint32_t` usage has been largely transitioned to `size_t` or `uint_fast32_t` which are typically the same size as the architecture (32 or 64 bits).
392   * This means that list/map/string sizes can be 64 bits on 64-bit architectures. Note that having 64-bit sizes on 32-bit architectures rarely make sense since they won't fit in the address space.
393 * New helper macros for instantiating state variables: `ZCBOR_STATE_D()` and `ZCBOR_STATE_E()` for decoding and encoding respectively.
394 * Add support for decoding payloads split over multiple memory chunks.
395   * There are new APIs in zcbor_common.h and zcbor_decode.h to handle this. Look for `zcbor_update_state()` and various functions with `fragment` in the name.
396   * Strings can be split between chunks, there is a new type `struct zcbor_string_fragment` for this purpose.
397   * Data headers can not be split.
398   * Backups to previous chunks cannot be restored.
399 * Split `zcbor_multi_encode()` into `zcbor_multi_encode()` and `zcbor_multi_encode_minmax()`. The former is more useful for manual use, while the latter is for generated code.
400 * Remove `zcbor_any_encode()` since it was just an alias for `zcbor_nil_put()`.
401 * Rename `zcbor_string_type_t` to `struct zcbor_string`.
402 * Rename `zcbor_state_backups_t` to `struct zcbor_state_constant`.
403 * Add support for decoding and encoding `undefined` CBOR values.
404 * `zcbor_any_decode()`:
405   * Rename to `zcbor_any_skip()`
406   * Add support for indeterminate-length arrays.
407   * Have `zcbor_any_skip()` consume any tags that are present.
408 * Introduce `zcbor_bstr_expect_ptr()`, `zcbor_bstr_put_ptr()`, `zcbor_tstr_expect_ptr()`, and `zcbor_tstr_put_ptr()`
409 * zcbor_common.h: Add an enum (`zcbor_rfc8949_tag`) with some tag values.
410 * Move CBOR intro text from zcbor_decode.h to README.
411 * Control asserts separately from verbose (add ZCBOR_ASSERT option)
412 * Introduce `zcbor_list_map_end_force_encode()` and `zcbor_list_map_end_force_decode()`.
413
414
415### Tests
416 * decode: Remove test4 since it hasn't been used or updated.
417 * New unit test directory and project. Tests:
418   * 64-bit vs 32-bit integers.
419   * 64-bit vs 32-bit strings.
420   * String encoding and decoding macros (`_lit()`, `_arr()`, `_term()`).
421   * Payload chunks and string fragments.
422 * Collect boilerplate Cmake code for tests into a new file test_template.cmake.
423 * Add tests for draft-ietf-suit-manifest-16.
424 * Rename "strange" tests to "corner_cases"
425 * Build tests with `-Wpedantic` and `-Wconversion`
426
427
428## Bugfixes:
429 * zcbor.py: Avoid #include-ing the full path of the type file.
430 * zcbor.py: Avoid creating functions with "None" result type.
431 * src: Fix code so it builds correctly with asserts enabled.
432 * zcbor_decode.c: Fix `list_map_start_decode()` to handle elem_count correctly
433 * zcbor_decode.c: Fix `zcbor_any_skip()` so it reverts the state correctly on fail.
434 * zcbor.py: Fix regex for ints/floats to ignore names with hyphens (-)
435 * zcbor.py: Fix error in 'convert' where a bstr dict value was incorrectly translated
436 * setup.py: Fix windows install
437 * zcbor.py: Add suffix for literal values larger than 32-bits.
438 * src: Fix code to build with `-Wpedantic` and `-Wconversion`.
439 * zcbor.py: Fix some code generation bugs to do with range checking (min/max size) of ints and CBOR-encoded bstrs.
440 * zcbor.py: Fix bug where indirection for ints with range checks was wrong.
441 * zcbor.py: Fix bugs in range checks in `bstr`s with `.cbor` statements.
442
443## Unsupported CDDL features
444
445Not all features outlined in the [CDDL spec](https://datatracker.ietf.org/doc/html/rfc8610) are supported by zcbor.
446The following is a list of limitations and missing features:
447
448 * Map elements in data must appear in the same order as they appear in the CDDL.
449 * C API doesn't support searching through a map.
450 * 16-bit floating point numbers (float16).
451 * Using `&()` to turn groups into choices (unions). `&()` is supported when used with `.bits`.
452 * Representation Types (`#x.y`), except for tags (`#6.y(foo)`) which are supported.
453 * Unwrapping (`~`)
454 * The control operator `.regexp`.
455 * The control operator `.ne`.
456 * The control operator `.default`.
457 * Generics (`foo<a, b>`).
458 * Most of the "Extended Diagnostic Notation" is unsupported.
459
460
461# cddl-gen v. 0.3.0 (2021-11-17)
462
463Any new bugs, requests, or missing features should be reported as [Github issues](https://github.com/NordicSemiconductor/cddl-gen/issues).
464
465## Improvements:
466
467### CDDL language
468 * Add more support for hexadecimal/octal/binary numbers in CDDL. E.g. in size ranges or value limits
469 * Add support for ranges with three dots in CDDL files
470 * Change CDDL quantifier syntax from `x**y` to `x*y`
471 * Add support for `$$` and `$`
472 * Add support for the `.bits` operator.
473
474### Command line
475 * Change command line name from `cddl_gen` to `cddl-gen`
476 * Add `--dq` as a shorthand for `--default-max-qty`
477 * Allow passing multiple cddl files via command line
478 * Allow adding the current git sha to generated file headers.
479 * Various changes to the logic for naming in code generation
480   * This can give different names of e.g. struct members compared with previous versions of cddl-gen
481 * Generate a cmake file when generating code.
482   * The `target_cddl_source()` Cmake function has been removed.
483   * See README.md for more info.
484
485### Python module
486 * Improve tags support in DataTranslator
487 * Improve decoding of cbor bstrs in DataTranslator
488   * Provide the raw string along with the decoded object.
489
490### C Libraries
491 * Refactor cbor_common.c
492 * Add support for indefinite length arrays in cbor_decode.c.
493
494### Tests
495 * Move all cddl files into tests/cases
496 * Run tests with twister instead of custom bash scripts
497 * Add tests for draft-ietf-suit-manifest-14
498
499
500## Bugfixes:
501 * cbor_encode.h: Add missing `.` in `tstrx_put` and `tstrx_put_term`
502 * cbor_encode.c: Fix `get_result_len` and add big-endian support
503 * cddl_gen.py: Fix bug where range checks were dropped
504 * cbor_decode.c: Fix bug where a `nil` could be interpreted as `true`
505 * cddl_gen.py: Fix parsing of ranges with no max (`n*` or `n**`)
506 * cbor_encode.c: Fix bug where minimum quantity restrictions were ignored
507 * cddl_gen: Fix generation of map-within-map
508 * cbor_decode.c: Add overflow checks and fix assert in `any_decode()`.
509
510
511## Unsupported CDDL features
512
513Not all features outlined in the [CDDL spec](https://datatracker.ietf.org/doc/html/rfc8610) are supported by cddl-gen.
514The following is a list of limitations and missing features:
515
516 * Map elements in data must appear in the same order as they appear in the CDDL.
517 * Floating point numbers.
518 * Using `&()` to turn groups into choices (unions). `&()` is supported when used with `.bits`.
519 * Representation Types (`#x.y`), except for tags (`#6.y(foo)`) which are supported.
520 * Unwrapping (`~`)
521 * The control operator `.regexp`.
522 * The control operator `.ne`.
523 * The control operator `.default`.
524 * Generics (`foo<a, b>`).
525 * Not all types from the "standard prelude" are supported.
526 * Most of the "Extended Diagnostic Notation" is unsupported.
527