Commit 423f94b
committed
Bring tinycbor up to date with mynewt tinycbor
- Removing cborencoder_close_container_checked.c since
cborencoder_close_container() checks the number of elements now.
- Add container_size for the container
- cbor_encoder_close_container(): look at isMap flag to determine
container_size for comparison
- 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
- Move cbor_encoder_get_extra_bytes_needed() and
cbor_encoder_get_buffer_size() to be part of cbor_buf_writer APIs
- Add bytes_needed field to the buf writer
- 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.
- Move enums to cbor_defs.h
- Use it->offset instead of it->ptr to track buffer offsets
- Update resolve_indicator() static api paramaters 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 teh buffer directly
Also, use offets instead of pointers to validate sorted maps
- Added a new dfine 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 buffers1 parent f39dcb8 commit 423f94b
File tree
30 files changed
+1122
-547
lines changed- src
- tests
- cpp
- encoder
- parser
- tojson
- tools
- cbordump
- json2cbor
30 files changed
+1122
-547
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
27 | | - | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
| 38 | + | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
| |||
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
58 | | - | |
| 64 | + | |
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
| |||
170 | 176 | | |
171 | 177 | | |
172 | 178 | | |
173 | | - | |
| 179 | + | |
174 | 180 | | |
175 | 181 | | |
176 | 182 | | |
| |||
215 | 221 | | |
216 | 222 | | |
217 | 223 | | |
218 | | - | |
| 224 | + | |
219 | 225 | | |
220 | 226 | | |
221 | 227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | | - | |
| 48 | + | |
47 | 49 | | |
0 commit comments