This commit adds the initial navigation data type and tools
which will lay the foundation to share and process navigation
data between the application and navigation systems like GNSS
and similar triangulation technologies.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
Variant of JSON_OBJ_DESCR_ARRAY_ARRAY that can be used when the
structure and JSON field names differ.
Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
Remove the top-level "structured data" group as in practice it was used
only by JSON APIs.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Analog to json_obj_encode vs. json_calc_encoded_len which
calculates the object len using json_obj_encode, introduce
json_calc_encoded_arr_len which calculates the length using
json_arr_encode. That is needed when the object to be encoded
is array on the root level.
Signed-off-by: Miika Karanki <miika.karanki@vaisala.com>
All examples in the header showcase the use of the type int in
structs that values should be parsed into (or serialized out of).
However, that is probably a bad idea if we consider the function
get_elem_size in the JSON library that calculates the field size:
static ptrdiff_t get_elem_size(const struct json_obj_descr *descr)
{
switch (descr->type) {
case JSON_TOK_NUMBER:
return sizeof(int32_t);
...
}
Hence, using int in structs on platforms where an int is not 32
bits wide (as rare as they may be) is probably a bad idea and will
lead to confusing errors and undefined behavior.
Signed-off-by: René Beckmann <rene.beckmann@grandcentrix.net>
The limiting factor is the output bitmask that says which elements have
been filled in by the parser. This patch changes the bitmask type from int
to int64_t.
Signed-off-by: Björn Stenberg <bjorn@haxx.se>
New Types:
* Added support for Generic Numeric type (float, 64-bit)
* Added support for Opaque string type.
* Added support parse Array data in object for seprate array parsing
New API for Json Array parsing Object 1 by 1:
* json_arr_separate_object_parse_init() init array parse
* json_arr_separate_parse_object() Parsing 1 Json Object
Rename token and lexer structures and publish those.
Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
In order to bring consistency in-tree, migrate all includes within
include directory to the new prefix <zephyr/...>. Note that the
conversion has been scripted, refer to zephyrproject-rtos#45388 for more
details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Move include paths and add new target_include_directories to support
backwards compatibility:
* /include -> /include/zephyr
example: <irq.h> -> <zephyr/irq.h>
Issue #41543
Signed-off-by: Yuval Peress <peress@google.com>