Home
last modified time | relevance | path

Searched full:for (Results 1 – 25 of 35) sorted by relevance

12

/zcbor-latest/
DLICENSE6 TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
10 "License" shall mean the terms and conditions for use, reproduction,
18 control with that entity. For the purposes of this definition,
27 "Source" form shall mean the preferred form for making modifications,
42 form, that is based on (or derived from) the Work and for which the
44 represent, as a whole, an original work of authorship. For the purposes
52 submitted to Licensor for inclusion in the Work by the copyright owner
54 the copyright owner. For the purposes of this definition, "submitted"
59 Licensor for the purpose of discussing and improving the Work, but
87 granted to You under this License for that Work shall terminate
[all …]
DRELEASE_NOTES.md8 * pypi_README.md: Add separate README for use in the pypi package
67 * Representation Types (`#x.y`), except for tags (`#6.y(foo)`) which are supported.
73 * Using `:` for map keys.
82 See also the [release notes for 0.8.0](#zcbor-v-080-2024-01-09) below.
91 * zcbor_common.h: Add forward declaration for strnlen()
100 * Representation Types (`#x.y`), except for tags (`#6.y(foo)`) which are supported.
106 * Using `:` for map keys.
116 * C library: Add support for searching for elements in a map.
123 * zcbor_debug.h: Add function for getting error string and printing it
126 * zcbor.py: Merge regexes for pure types without values
[all …]
DARCHITECTURE.md49 `self.value` means different things for different values of `self.type`.
50 E.g. for `"UINT"`, `self.value` has the value dictated by the type, or `None` if different values a…
57 For container types, i.e `"LIST"`, `"MAP"`, `"GROUP"`, and `"UNION"`, `self.value` contains a list …
59 For `"OTHER"`, `self.value` is a string with the name of the type it refers to.
83 There are one or more expressions for each base type.
85 For container types, the regex will match the whole type, and then recursively parse the children w…
90 CddlXcoder inherits from CddlParser, and provides common functionality for DataTranslator and CodeG…
94 - Common names for members in generated code. A single type possibly needs multiple member variable…
105 DataTranslator is for handling and manipulating CBOR on the "host".
106 For example, the user can compose data in YAML or JSON files and have them converted to CBOR and va…
[all …]
DREADME.md4 …ipedia.org/wiki/CBOR) library in the C language (C++ compatible), tailored for use in microcontrol…
9 It can for example validate a YAML file against a schema and convert it into CBOR.
24 …- To generate C code (using the Python script) for validating and decoding or encoding CBOR, for u…
26 - Validate a YAML/JSON file and translate it into CBOR e.g. for transmission.
48 The benefit of using code generation is greater for decoding than encoding.
60 The library is also used by generated code. See the [Code generation](#code-generation) section for
67 …macros, look below or in the [hello_world](samples/hello_world/src/main.c) sample for example code.
72 `elem_count` is one reason for needing "backup" states (the other is to allow rollback of the paylo…
73 Backups are needed for _decoding_ if there are any lists, maps, or CBOR-encoded strings (`zcbor_bst…
74 Backups are needed for _encoding_ if there are any lists or maps *and* you are using canonical enco…
[all …]
DMIGRATION_GUIDE.md5 Instead, use the specific functions for the currently supported simple values, i.e.
24 For example:
27 * Names sometimes gain suffixes like ``_m`` or ``_l`` for disambiguation.
Dpypi_README.md19 Please visit the [Github repository](https://github.com/NordicSemiconductor/zcbor) for more informa…
/zcbor-latest/zcbor/
Dzcbor.py149 """Return an argument list for a function call to a encoder/decoder function."""
172 """Return the name of the struct argument for a given mode."""
210 """Class for parsing CDDL.
213 - For repeated data, one instance represents all repetitions.
214 - For "OTHER" types, one instance points to another type definition.
215 - For "GROUP" and "UNION" types, there is no separate data item for the instance.
221 # The value of the data item. Has different meaning for different
224 self.max_value = None # Maximum value. Only used for numbers and bools.
225 self.min_value = None # Minimum value. Only used for numbers and bools.
230 # The size of the element. Only used for integers, byte strings, and
[all …]
/zcbor-latest/scripts/
Dregenerate_samples.py32 contents = "".join(p.read_text(encoding="utf-8") for p in files)
34 list(makedirs(tmpdir / f.relative_to(p_pet_sample).parent, exist_ok=True) for f in files)
35 list(copy2(f, tmpdir / f.relative_to(p_pet_sample)) for f in files)
37 new_contents = "".join(p.read_text(encoding="utf-8") for p in files)
38 list(copy2(tmpdir / f.relative_to(p_pet_sample), f) for f in files)
Dadd_helptext.py33 for cmd in commands:
/zcbor-latest/samples/pet/src/
Dmain.c16 for (int i = 0; i < pet->names_count; i++) { in print_pet()
20 for (int i = 0; i < pet->birthday.len; i++) { in print_pet()
44 printf("Decoding failed for pet1: %d\r\n", err); in get_pet1()
72 printf("Encoding failed for pet2: %d\r\n", zcbor_peek_error(encoding_state)); in get_pet2()
79 printf("Decoding failed for pet2: %d\r\n", err); in get_pet2()
109 printf("Encoding failed for pet3: %d\r\n", err); in get_pet3()
116 printf("Decoding failed for pet3: %d\r\n", err); in get_pet3()
/zcbor-latest/tests/scripts/
Dtest_repo_files.py48 result = style.check_files([str(f) for f in files])
86 commands_build = [(line.split(' ')) for line in to_build.split('\n')]
89 for c in commands_build:
92 for c in commands_run:
106 """Check the zcbor-generated code for the "pet" sample"""
113 for p in [f for f in files if "pet" in f.name]:
131 """Overridden to get base URL for relative links from remote tracking branch."""
179 for m in matches:
183 # Github sometimes need the filename for anchor (#) links to work, so add it:
191 for t in threads:
[all …]
Dtest_zcbor.py41 p_test_vectors12 = tuple(Path(p_cases, f'manifest12_example{i}.cborhex') for i in range(6))
42 p_test_vectors14 = tuple(Path(p_cases, f'manifest14_example{i}.cborhex') for i in range(6))
43 p_test_vectors16 = tuple(Path(p_cases, f'manifest14_example{i}.cborhex') for i in range(6)) # Iden…
44 p_test_vectors20 = tuple(Path(p_cases, f'manifest20_example{i}.cborhex') for i in range(6))
61 """Class for testing examples against CDDL for various versions of the SUIT manifest spec."""
67 cddl_str = " ".join((Path(p).read_text(encoding="utf-8") for p in cddl_paths))
282 struct4[1][1] = cbor2.CBORTag(112, struct4[1][1]) # Add the tag for cbor-pen
296 struct3.tag = 99999 # invalid tag for COSE_Sign1
665 for p in (tempd / "src" / "pet_decode.c", tempd / "src" / "pet_encode.c",
/zcbor-latest/src/
Dzcbor_print.c19 for (size_t j = 0; j < size; j++) { in zcbor_print_compare_lines()
23 for (size_t j = 0; j < size; j++) { in zcbor_print_compare_lines()
27 for (size_t j = 0; j < size; j++) { in zcbor_print_compare_lines()
39 for (size_t i = 0; i <= size / col_width; i++) { in zcbor_print_compare_strings()
53 for (size_t i = 0; i <= size / col_width; i++) { in zcbor_print_compare_strings_diff()
Dzcbor_common.c101 for (unsigned int i = 0; i < state->constant_state->current_backup; i++) { in update_backups()
195 for (size_t i = 0; i < num_fragments; i++) { in zcbor_validate_string_fragments()
216 for (size_t i = 0; i < num_fragments; i++) { in zcbor_validate_string_fragments()
233 for (size_t i = 0; i < num_fragments; i++) { in zcbor_splice_string_fragments()
328 #define F16_EXPO_MSK 0x1F /* Bitmask for the exponent (right shifted by F16_EXPO_OFFS). */
329 #define F16_MANTISSA_MSK 0x3FF /* Bitmask for the mantissa. */
340 #define F32_EXPO_MSK 0xFF /* Bitmask for the exponent (right shifted by F32_EXPO_OFFS). */
341 #define F32_MANTISSA_MSK 0x7FFFFF /* Bitmask for the mantissa. */
345 #define SUBNORM_ROUND_MSK (F32_MANTISSA_MSK | (1 << F32_EXPO_OFFS)) /* mantissa + lsb of expo for
350 * for tiebreak. */
[all …]
Dzcbor_encode.c78 for (; result_len > 0; result_len--) { in value_encode_len()
124 for (unsigned int i = 0; i < int_size; i++) {
249 /* Use a dummy value for the sake of the length calculation below.
589 for (size_t i = 0; i < num_encode; i++) {
/zcbor-latest/include/
Dzcbor_decode.h19 /** The zcbor_decode library provides functions for decoding CBOR data elements.
21 * See The README for an introduction to CBOR, including the meaning of pint,
31 /** Convenience macro for declaring and initializing a decoding state with backups.
41 * @param[in] n_flags For use if ZCBOR_MAP_SMART_SEARCH is enabled, ignored otherwise.
115 * (for use as a zcbor_decoder_t function) */
154 /** Search for a key in a map.
163 * This function searches for keys. When this function returns successfully,
173 * kept for each element, instead of a rolling count.
183 * When searching for strings, there are convenience functions available,
189 * For example, a zcbor_*_pexpect() function.
[all …]
Dzcbor_encode.h20 /** The zcbor_encode library provides functions for encoding CBOR data elements.
22 * See The README for an introduction to CBOR, including the meaning of pint,
31 /** Convenience macro for declaring and initializing an encoding state with backups.
52 * but when a @ref zcbor_encoder_t is needed, such as for @ref zcbor_multi_encode,
102 * This serves as a size hint for the header. Must be
155 * @ref zcbor_tstr_put, @ref zcbor_nil_put, etc. For _put() functions,
157 * @p input_len will determine how much the value changes for each call.
160 * generated by the zcbor.py script, which for example encodes larger chunks of
168 * The input pointer is moved @p input_len bytes for
Dzcbor_common.h90 /** The zcbor_state_t structure is used for both encoding and decoding. */
174 * code, except for zcbor_multi_decode.
201 /** Convenience macro for failing out of a decoding/encoding function.
263 …AG_KEEP_DECODE_STATE 8UL ///! Keep the pre-restore decode state (everything only used for decoding)
293 /** Initial value for elem_count for when it just needs to be large. */
306 /** Convenience function for starting encoding/decoding of a union.
308 * That is, for attempting to encode, or especially decode, multiple options.
333 * The elem_state is only needed for unordered maps, when ZCBOR_MAP_SMART_SEARCH is enabled.
403 * For use when the payload is divided into multiple chunks.
437 * The fragments are copied in the order they appear, without regard for
[all …]
/zcbor-latest/tests/fuzz/
Dtest-afl.sh9 # For convenience (use for extra checks):
11 # For convenience (use if afl fails and recommends this):
/zcbor-latest/tests/unit/test3_float16/src/
Dmain.c36 #define F16_MANTISSA_MSK 0x3FF /* Bitmask for the mantissa. */
51 for (int i = 0; i <= 0xFFFF; i++) { in ZTEST()
96 * As an optimization, fp_bytes_encode.bin contains only values for the positive
188 for (uint32_t i = START_ZERO; i < START_NONZERO_FINITE; i++) { in ZTEST()
191 for (uint32_t i = START_NONZERO_FINITE; i < START_INFINITE; i++) { in ZTEST()
194 for (uint32_t i = START_INFINITE; i < START_NAN; i++) { in ZTEST()
197 for (uint32_t i = START_NAN; i < 0x80000000; i++) { in ZTEST()
/zcbor-latest/samples/pet/include/
Dpet_types.h23 /** Which value for --default-max-qty this file was created with.
28 * See `zcbor --help` for more information about --default-max-qty
/zcbor-latest/samples/hello_world/src/
Dmain.c18 /* Create zcbor state variable for encoding. */ in main()
29 /* Create zcbor state variable for decoding. */ in main()
/zcbor-latest/samples/pet/
DREADME.md14 …ee representations. Changing [pet1.yml](pet1.yml) will change the printed output for the first pet.
15 To change the output for the second and third, change the code in [src/main.c](src/main.c).
DCMakeLists.txt17 …-c ${CMAKE_CURRENT_LIST_DIR}/../../tests/cases/pet.cddl # Generate code for the data structures in…
18 -t Pet # Create a public API for decoding/encoding the "Pet" type from pet.cddl
/zcbor-latest/tests/decode/test5_corner_cases/
Dfloats.py8 # It's kept here for posterity.
17 for b in bytestr:

12