Home
last modified time | relevance | path

Searched refs:value (Results 1 – 25 of 30) sorted by relevance

12

/zcbor-3.6.0/zcbor/
Dzcbor.py125 def val_or_null(value, var_name): argument
126 return "(%s = %d, &%s)" % (var_name, value, var_name) if value is not None else "NULL"
130 def tmp_str_or_null(value): argument
131 value_str = f'"{value}"' if value is not None else 'NULL'
137 def min_bool_or_null(value): argument
217 self.value = None
319 (key, value, slashes)
320 for (_1, key, slashes, value, _2) in getrp(type_regex, S | M).findall(instr)]
321 for key, value, slashes in types:
324 result[key] += value
[all …]
/zcbor-3.6.0/tests/fuzz/
Dfuzz_manifest12.c20 …SUIT_Envelope_suit_integrated_dependency_key[i].SUIT_Envelope_suit_integrated_dependency_key.value, in fuzz_one_input()
35 .SUIT_Severable_Manifest_Members_suit_dependency_resolution.value, in fuzz_one_input()
53 .SUIT_Severable_Manifest_Members_suit_payload_fetch.value, in fuzz_one_input()
71 .SUIT_Severable_Manifest_Members_suit_install.value, in fuzz_one_input()
89 .SUIT_Unseverable_Members_suit_validate.value, in fuzz_one_input()
107 .SUIT_Unseverable_Members_suit_load.value, in fuzz_one_input()
125 .SUIT_Unseverable_Members_suit_run.value, in fuzz_one_input()
/zcbor-3.6.0/tests/cases/
Dsenml.cddl12 * key-value-pair
16 key-value-pair = ( label => value )
22 value = tstr / bstr / numeric / bool
Dmanifest-moran4.cddl161 suit-condition-version-comparison-value: SUIT_Condition_Version_Comparison_Value
/zcbor-3.6.0/src/
Dzcbor_common.c198 if (fragments[i].fragment.value == NULL) { in zcbor_validate_string_fragments()
238 fragments[i].fragment.value, fragments[i].fragment.len); in zcbor_splice_string_fragments()
251 && (str1->value != NULL) && (str2->value != NULL) && (str1->len == str2->len) in zcbor_compare_strings()
252 && (memcmp(str1->value, str2->value, str1->len) == 0); in zcbor_compare_strings()
256 size_t zcbor_header_len(uint64_t value) in zcbor_header_len() argument
258 if (value <= ZCBOR_VALUE_IN_HEADER) { in zcbor_header_len()
260 } else if (value <= 0xFF) { in zcbor_header_len()
262 } else if (value <= 0xFFFF) { in zcbor_header_len()
264 } else if (value <= 0xFFFFFFFF) { in zcbor_header_len()
272 size_t zcbor_header_len_ptr(const void *const value, size_t value_len) in zcbor_header_len_ptr() argument
[all …]
Dzcbor_decode.c392 result->value = state->payload;
434 state->payload_end = result->value + result->len;
497 result->fragment.value = state->payload_mut;
513 result->fragment.value = state->payload_mut;
613 struct zcbor_string zs = { .value = (const uint8_t *)ptr, .len = len };
622 struct zcbor_string zs = { .value = (const uint8_t *)ptr, .len = len };
939 struct zcbor_string zs = { .value = (const uint8_t *)ptr, .len = len };
947 struct zcbor_string zs = { .value = (const uint8_t *)ptr, .len = len };
1114 uint8_t value; local
1116 if (!zcbor_simple_decode(state, &value)) {
[all …]
Dzcbor_encode.c215 if (input->value && ((zcbor_header_len_ptr(&input->len, sizeof(input->len))
269 result->value = state->payload_end - remaining_str_len(state);
270 result->len = (size_t)payload - (size_t)result->value;
290 if (state->payload_mut != input->value) {
293 memmove(state->payload_mut, input->value, input->len);
314 const struct zcbor_string zs = { .value = (const uint8_t *)str, .len = len };
322 const struct zcbor_string zs = { .value = (const uint8_t *)str, .len = len };
/zcbor-3.6.0/tests/decode/test9_manifest14/src/
Dmain.c48 digest->SUIT_Digest_suit_digest_bytes.value, in ZTEST()
68 zassert_mem_equal(exp_signature, cose_sign1->COSE_Sign1_signature.value, in ZTEST()
106 zassert_equal(ZCBOR_SUCCESS, cbor_decode_SUIT_Manifest(envelope.SUIT_Envelope_suit_manifest.value, in ZTEST()
112 …_Manifest_suit_common_cbor.SUIT_Common_suit_common_sequence.SUIT_Common_suit_common_sequence.value, in ZTEST()
116 …_Manifest_suit_common_cbor.SUIT_Common_suit_common_sequence.SUIT_Common_suit_common_sequence.value, in ZTEST()
137 parameter->SUIT_Parameters_suit_parameter_vendor_identifier_RFC4122_UUID_m.value, in ZTEST()
148 parameter->SUIT_Parameters_suit_parameter_class_identifier.value, in ZTEST()
161 parameter->SUIT_Parameters_suit_parameter_image_digest_cbor.SUIT_Digest_suit_digest_bytes.value, in ZTEST()
222 zassert_equal(ZCBOR_SUCCESS, cbor_decode_SUIT_Manifest(envelope.SUIT_Envelope_suit_manifest.value, in ZTEST()
228 …_Manifest_suit_common_cbor.SUIT_Common_suit_common_sequence.SUIT_Common_suit_common_sequence.value, in ZTEST()
[all …]
/zcbor-3.6.0/samples/pet/src/
Dmain.c17 printf(" %.*s", (int)pet->names[i].len, pet->names[i].value); in print_pet()
21 printf("%02x", pet->birthday.value[i]); in print_pet()
97 encoded_pet.names[0].value = first_name; in get_pet3()
99 encoded_pet.names[1].value = last_name; in get_pet3()
102 encoded_pet.birthday.value = timestamp3; in get_pet3()
/zcbor-3.6.0/tests/encode/test2_simple/src/
Dmain.c40 .names = {{.value = "foo", .len = 3}, {.value = "bar", .len = 3}}, in ZTEST()
42 .birthday = {.value = (uint8_t[]){1,2,3,4,5,6,7,8}, .len = 8}, in ZTEST()
104 .value = timestamp, in ZTEST()
/zcbor-3.6.0/
DARCHITECTURE.md27 The two most important member variables in CddlParser are `self.value` and `self.type`.
49 `self.value` means different things for different values of `self.type`.
50 …elf.value` has the value dictated by the type, or `None` if different values are allowed, so in th…
57 For container types, i.e `"LIST"`, `"MAP"`, `"GROUP"`, and `"UNION"`, `self.value` contains a list …
58 The code usually refers to the elements/contents in `self.value` as "children".
59 For `"OTHER"`, `self.value` is a string with the name of the type it refers to.
69 1. `Foo`, which has `self.type = "UINT"` and `self.value = None`
70 2. An anonymous child of Bar, which has `self.type = "OTHER"`, and `self.value = "Foo"`
71 3. Bar, which has `self.type = "LIST"`, and `self.value` is a python `list` containing the above ob…
75 Children of `"MAP"` objects come in key/value pairs.
[all …]
DREADME.md95 … always using minimal length encoding (e.g. not using 16 bits to encode a value < 256). Note: the …
96 …cbor_log()`), and also a trace message (`zcbor_trace()`) for each decoded value, and in each gener…
154 … string: In YAML, such key value pairs are represented as `{"zcbor_keyval<unique int>": {"key": <k…
156 …4. undefined: In cbor2, undefined has its own value `cbor2.types.undefined`. In YAML, undefined is…
284 - `nil`: Nil/Null value
285 - `float`: Floating point value
291 …- `{}`: Map. Key/value pairs as are declared as `<key> => <value>` or `<key>: <value>`. Note that …
297 …mber: `Foo = 3`, where Foo is a uint with the additional requirement that it must have the value 3.
298 - Number range: `Foo = -100..100`, where Foo is an int with value between -100 and 100.
312 …(int => bstr)}` where Foo is a map with 4 to 8 key/value pairs where each key is an int and each v…
[all …]
DRELEASE_NOTES.md236 …* Allow --default-max-qty to accept a string label when generating code so that the value can be c…
241 …e zcbor_state_t objects: Allow single states as input to zcbor_new_state() and remove return value.
243 * Add zcbor_peek_error() for reading the error value without clearing it.
309 * Add error value to state, which is populated when a function fails (returns `false`).
358 * zcbor.py: Fix error in 'convert' where a bstr dict value was incorrectly translated
391 …* Add more support for hexadecimal/octal/binary numbers in CDDL. E.g. in size ranges or value limi…
/zcbor-3.6.0/tests/decode/test2_suit/src/
Dmain.c115 .value, in ZTEST()
124 .value, in ZTEST()
141 .value, in ZTEST()
176 .value, in ZTEST()
/zcbor-3.6.0/tests/encode/test4_senml/src/
Dmain.c36 .record_bn = {.record_bn = {.value = "Foo", .len = 3}}, in ZTEST()
40 .record_n = {.record_n = {.value = "Bar", .len = 3}}, in ZTEST()
/zcbor-3.6.0/tests/decode/test7_suit9_simple/src/
Dmain.c108 envelope1.SUIT_Envelope_suit_manifest.value, in ZTEST()
128 envelope1.SUIT_Envelope_suit_manifest.value, in ZTEST()
/zcbor-3.6.0/tests/decode/test3_simple/src/
Dmain.c445 zassert_mem_equal("foo", pet.names[0].value, 3, "Expect first name 'foo'"); in ZTEST()
446 zassert_mem_equal("bar", pet.names[1].value, 3, "Expect first name 'bar'"); in ZTEST()
448 zassert_mem_equal(exp_birthday, pet.birthday.value, 8, "Expect birthday"); in ZTEST()
/zcbor-3.6.0/tests/encode/test3_corner_cases/src/
Dmain.c202 .opt_cbor.opt_cbor.value = (uint8_t[]){0x1A, 0x12, 0x34, 0x56, 0x78}, in ZTEST()
216 .opt_cbor.opt_cbor.value = (uint8_t[]){0x19, 0x12, 0x34}, in ZTEST()
372 strings1.threehundrebytebstr.value = bytes300; in ZTEST()
374 strings1.tentothirtybytetstr.value = bytes300; in ZTEST()
381 strings2.threehundrebytebstr.value = bytes300; in ZTEST()
383 strings2.tentothirtybytetstr.value = bytes300; in ZTEST()
388 strings1.cborNumbers.value = output2; in ZTEST()
392 strings2.cborNumbers.value = output1; in ZTEST()
399 strings1.optCborStrings.value = output3; in ZTEST()
621 {.twotothree = {.value = "hello", .len = 5}}, in ZTEST()
[all …]
/zcbor-3.6.0/tests/decode/test1_suit_old_formats/src/
Dmain.c144 .value, in ZTEST()
194 .value, in ZTEST()
342 .SUIT_Prioritized_URI_uri.value, in ZTEST()
/zcbor-3.6.0/samples/hello_world/src/
Dmain.c40 printf("Decoded string: '%.*s'\r\n", (int)decoded_string.len, decoded_string.value); in main()
/zcbor-3.6.0/include/
Dzcbor_common.h41 const uint8_t *value; member
454 size_t zcbor_header_len(uint64_t value);
457 size_t zcbor_header_len_ptr(const void *const value, size_t value_len);
/zcbor-3.6.0/tests/scripts/
Dtest_zcbor.py271 struct2 = loads(struct.value[3]) # manifest
279 struct.value[3] = dumps(struct2)
288 struct2 = loads(struct.value[2]) # authentication
292 struct.value[2] = dumps(struct2)
304 struct2 = loads(struct.value[3]) # manifest
306 struct.value[3] = dumps(struct2)
318 struct.value[23] = b'' # Invalid integrated payload key
330 struct2 = loads(struct.value[3]) # manifest
338 struct.value[3] = dumps(struct2)
415 struct2 = loads(struct.value[3]) # manifest
[all …]
/zcbor-3.6.0/tests/unit/test1_unit_tests/src/
Dmain.c153 struct zcbor_string tstr = {.value = large_string, .len = STR_SIZE}; in ZTEST()
172 zassert_equal_ptr(tstr_res.value, &large_payload[9], NULL); in ZTEST()
173 zassert_mem_equal(tstr_res.value, large_string, tstr.len, NULL); in ZTEST()
227 struct zcbor_string failing_string = {.value = NULL, .len = 1000}; in ZTEST()
413 zassert_equal_ptr(&payload[1], output_frags[0].fragment.value, NULL); in ZTEST()
423 zassert_equal_ptr(&payload[8], output_frags[1].fragment.value, NULL); in ZTEST()
430 output.value = spliced; in ZTEST()
437 zassert_mem_equal(output.value, "HelloWorld", 10, NULL); in ZTEST()
489 zassert_mem_equal(output.value, in ZTEST()
598 zassert_equal_ptr(&payload[1], output_frags[0].fragment.value, NULL); in ZTEST()
[all …]
/zcbor-3.6.0/tests/encode/test1_suit/src/
Dmain.c250 int res = cbor_decode_SUIT_Command_Sequence(sequence_str->value, in test_command_sequence()
261 zassert_mem_equal(sequence_str->value, in test_command_sequence()
/zcbor-3.6.0/tests/decode/test5_corner_cases/src/
Dmain.c479 zassert_equal(ZCBOR_SUCCESS, cbor_decode_Strings(strings1.optCborStrings.value, in ZTEST()
481 zassert_equal(ZCBOR_SUCCESS, cbor_decode_Numbers(strings1.cborNumbers.value, in ZTEST()
483 zassert_equal(ZCBOR_SUCCESS, cbor_decode_Numbers(strings2.cborNumbers.value, in ZTEST()
487 zassert_equal(0, strings1.threehundrebytebstr.value[0], NULL); in ZTEST()
488 zassert_equal(9, strings1.threehundrebytebstr.value[299], NULL); in ZTEST()
828 zassert_mem_equal("hello", map.twotothree[0].twotothree.value, in ZTEST()
842 zassert_mem_equal("hello", map.twotothree[0].twotothree.value, in ZTEST()
1095 zassert_mem_equal("hello", output.optStr3to6.value, 5, NULL); in ZTEST()
1314 zassert_mem_equal(result_bstr.value, "hello", result_bstr.len, NULL); in ZTEST()
1791 zassert_equal(&cbor_bstr_payload1[2], result.CBORBstr.value, NULL); in ZTEST()
[all …]

12