Commit 2f4c399
committed
tinycbor: Pulling in patch from mynewt upstream PR
- Pulling in code from intel/tinycbor#83 as a
patch to zephyr's ext/tinycbor. This is to facilitate the use of
chained buffers functionality for tinycbor while it is in development
on https://github.com/intel/tinycbor
- Bring tinycbor up to date with mynewt tinycbor
- Changing implementation of cbor_encoder_get_extra_bytes_needed() and
cbor_encoder_get_buffer_size() as part of cbor_buf_writer APIs
- Move bytes_needed field from CborEncoder to the buf writer, this is
needed by the tests mainly.
- Fix cbor_buf_cmp to do memcmp and return complemented result
iterate_string_chunks(): fixing NULL compare at the end of string
and moving it out of the iterate_string_chunks(). This is to avoid
buffer specific parser calls in the function
- cbor_value_get_next_byte() is removed in mynewt version of tinycbor,
so, we track offsets of the buffer which can be used for comparison
in the parser tests instead of calculating the offset
- Making the decoder and parser APIs backwards compatible
- Adding encoder writer and parser reader as part of the encoder and
parser structure. This is to make the encoder and parser use new
function of encoder_writer and decoder_reader without breaking
backwards compatibility.
- Making the old API use flat buffers by default
- Adding APIs for initializing encoder and parser with custom writer
and reader
- Make the default writer and reader conditional based on
NO_DFLT_READER/WRITER define. This is because we want a default
reader/writer to avoid API changes.
- Use it->offset instead of it->ptr to track buffer offsets
- Update resolve_indicator() static api parameters to use cbor value
and access offsets instead of taking pointers as input parameters
- In validate_container() do a byte by byte comparison instead of
memcmp since we no longer have access to the buffer directly
- Also, use offsets instead of pointers to validate sorted maps
- Added a new define for conditionally compiling in float support
(NO_FLOAT_SUPPORT).
- This is because we want the float support to be compiled in by
default.
- Use static_assert macro instead of Static_assert. Changed to avoid
build failures.
- Add api to get string chunk, this is a callback which can be used by
buffer implementations to grab a string that is divided in chunks
which spans across multiple chained buffers
- Add KConfig and CMakeList files for configuration and build
- Delete .gitignore and .gitattributes
- Remove tools, tests and examples as they are not really needed for
building the library
Signed-off-by: Vipul Rahane <[email protected]>1 parent 3f85f24 commit 2f4c399
File tree
49 files changed
+978
-5236
lines changed- ext
- lib
- encoding
- tinycbor
- examples
- src
- tests
- cpp
- encoder
- parser
- tojson
- tools
- cbordump
- json2cbor
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
49 files changed
+978
-5236
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments