Lines Matching refs:a

4 zcbor is a low footprint [CBOR](https://en.wikipedia.org/wiki/CBOR) library in the C language (C++ …
5 It comes with a schema-driven script tool that can validate your data, or even generate code.
9 It can for example validate a YAML file against a schema and convert it into CBOR.
14 The schema language used by zcbor is CDDL (Concise Data Definition Language) which is a powerful hu…
23 …- As a low-footprint CBOR decoding/encoding library similar to TinyCBOR/QCBOR/NanoCBOR. The librar…
26 - Validate a YAML/JSON file and translate it into CBOR e.g. for transmission.
27 - Validate a YAML/JSON/CBOR file before processing it with some other tool
29 - As part of a python script that processes YAML/JSON/CBOR files.
31 - Do validation against a CDDL schema.
32 - Create a read-only representation via named tuples (with names taken from the CDDL schema).
40 1. The [hello_world sample](samples/hello_world/README.md) is a minimum examples of encoding and de…
41 2. The [pet sample](samples/pet/README.md) shows a how to use the C library together with generated…
50 The code generation will provide a number of checks that are tedious to write manually.
67 To do encoding or decoding with the library, instantiate a `zcbor_state_t` object, which is most ea…
70 `elem_count` starts again when entering a nested list or map, and is restored when exiting.
82 /** Initialize a decoding state (could include an array of backup states).
94 The C library has a few compile-time configuration options.
100 … and always using minimal length encoding (e.g. not using 16 bits to encode a value < 256). Enabli…
101 … | Print log messages on encoding/decoding errors (`zcbor_log()`), and also a trace message (`zcbo…
102 …ents instruct the current function to return a `ZCBOR_ERR_ASSERTION` error. If `ZCBOR_VERBOSE` is …
105 … When enabled, a flag is kept for each element in an array, ensuring it is not processed twice. If…
111 The zcbor.py script can directly read CBOR, YAML, or JSON data and validate it against a CDDL descr…
113 It can also output the data to a C file formatted as a byte array.
136 Importing zcbor in a Python script
144 …This is a format where the serialization types (map, list, string, number etc.) are mapped directl…
153 Since CBOR supports more data types than YAML and JSON, zcbor can optionally use a bespoke format w…
156 The following data types are supported by CBOR, but not by YAML (or JSON which is a subset of YAML):
160 …3. tags: In cbor2, tags are represented by a special type, `cbor2.CBORTag`. In YAML, these are rep…
178 Finally, it takes the "entry types" (`-t`) and creates a public API function for each of them.
179 While doing these things, it will make a number of optimizations, e.g. inlining code for small type…
180 It outputs the generated code into header and source files and optionally creates a CMake file to b…
188 …- A CMake file that creates a library with the generated code and the C library (if `--output-cmak…
191 …tent (e.g. values/sizes of ints or strings), and repetition (e.g. the number of members in a list).
192 … it will check all the restriction set in the CDDL description, and fail if a restriction is broke…
202 When calling zcbor with the argument `--output-cmake <file path>`, a CMake file will be created at …
203 The generated CMake file creates a target library and adds the generated and non-generated source f…
244 Which takes a yaml structure from mypet.yaml, validates it against the Pet type in the CDDL descrip…
249 Here is an example call for validating a JSON file:
298 …- `/`: Unions. Analogous to unions in C. E.g. `Foo = int/bstr/Bar` where Foo is either an int, a b…
302 …- Number: `Foo = 3`, where Foo is a uint with the additional requirement that it must have the val…
304 - Text string: `Foo = "hello"`, where Foo is a tstr with the requirement that it must be "hello".
305 - True/False: `Foo = false`, where Foo is a bool which is always false.
309 …- `.size`: Works for integers and strings. E.g. `Foo = uint .size 4` where Foo is a uint exactly 4…
310 …- `.cbor`/`.cborseq`: E.g. `Foo = bstr .cbor Bar` where Foo is a bstr whose contents must be CBOR …
314 …`: 0 or 1 time. E.g. `Foo = [int, ?bstr]`, where Foo is a list with an int possibly followed by a
315 - `*`: 0 or more times. E.g. `Foo = [*tstr]`, where Foo is a list containing 0 or more tstrs.
317 …o = {4*8(int => bstr)}` where Foo is a map with 4 to 8 key/value pairs where each key is an int an…
331 The following is a list of limitations and missing features:
340 * Generics (`foo<a, b>`).
349 CBOR's format is described well on [Wikipedia](https://en.wikipedia.org/wiki/CBOR), but here's a sy…
367 * `pint`: Interpret the _Value_ as a positive integer.
368 * `nint`: Interpret the _Value_ as a positive integer, then multiply by -1 and subtract 1.
377 …* 24: Interpret the _Value_ as a 1 byte simple value. These simple values are currently unassigned.
387 If a `list` or `map` has _Additional info_ 31, it is "indefinite-length", which means it has an "un…
388 Instead, its end is marked by a `simple` with _Additional info_ 31 (byte value 0xFF).
394 zcbor (then "cddl-gen") was initially conceived as a code generation project.
398 This is where code generation could pull a lot of weight.
422 Parse a CDDL file and validate/convert between YAML, JSON, and CBOR. Can also
447 Parse a CDDL file and produce C code that validates and xcodes CBOR.
448 The output from this script is a C file and a header file. The header file
454 Where a `bstr .cbor <Type>` is specified in the CDDL, AND the Type is an entry
455 type, the xcoder will not xcode the string, only provide a pointer into the
474 types. The default_max_qty can usually be set to a
508 target in the file. The CMake file defines a CMake
523 --time-header Put the current time in a comment in the generated
525 --git-sha-header Put the current git sha of zcbor in a comment in the
537 will cause a compile error. If so, tweak the CDDL
543 generated files, e.g. copyright. Can be a string or a
544 path to a file. If interpreted as a path to an
558 Read CBOR, YAML, or JSON data from file or stdin and validate it against a
584 that will be decoded by generated code. If omitted, a
609 Parse a CDDL file and validate/convert between CBOR and YAML/JSON. The script
610 decodes the CBOR/YAML/JSON data from a file or stdin and verifies that it
637 that will be decoded by generated code. If omitted, a
662 instantiation. If omitted, the entire declaration is a