Commit Graph
17 Commits
Author SHA1 Message Date
Petteri Aimonen 0f48278975 Compatibility fixes in tests for AVR 2019-12-16 15:10:10 +02:00
Petteri Aimonen 6a595279b2 New field descriptor format.
Now field information is stored as a variable-length uint32_t array.
This reduces the minimum size in most cases:

                            old            new
basic field:                10 bytes       4 bytes
repeated field:             10 bytes       8 bytes
field with 12bit tag/size:  16 bytes       8 bytes
field with 16bit tag/size:  16 bytes       16 bytes
field with 32bit tag/size:  28 bytes       16 bytes

Further, now the descriptor size can be increased per-field and per-message,
instead of previous global PB_FIELD_16BIT and PB_FIELD_32BIT.

PB_FIELD_32BIT still affects the pb_size_t type, which is 16-bit by default.
2019-01-25 18:56:34 +02:00
Petteri Aimonen 2210cd92a6 Big refactoring to better separate field descriptor encoding from logic.
This will enable further development of the field descriptor encoding.
2019-01-25 18:56:34 +02:00
Petteri Aimonen c59a9d7e7a Combine pb_encode_varint32() into pb_encode_varint() 2017-05-05 07:53:21 +03:00
Petteri Aimonen 885d810fb0 Merge branch 'pb_encode32' of https://github.com/ewalt1/nanopb into dev_0.4 2017-05-05 07:36:07 +03:00
Petteri Aimonen bee8e20e1d Unit test updates for the string length 2017-05-03 07:42:03 +03:00
Alice Wang f7013275cc unit test fix for checking string encoding length 2017-05-03 07:42:02 +03:00
Nick Ewalt 4b3b4b1bab Add pb_encode_varint32 and pb_encode_svarint32
- Optimized 32 bit versions of pb_encode_varint and pb_encode_svarint
2017-03-15 16:08:06 -07:00
Petteri Aimonen 38613acdb4 Add a few missing unit tests 2014-09-07 20:30:17 +03:00
Petteri Aimonen 1dd9f1900f Change the _count fields to use pb_size_t datatype.
Update issue 82
Status: FixedInGit
2014-08-18 20:09:52 +03:00
Petteri Aimonen a641e21b34 Separate field iterator logic from pb_decode to pb_common. 2014-08-10 12:42:01 +03:00
Petteri Aimonen b63e582bdb Add a convenience function pb_get_encoded_size()
There is minimal size penalty from this, and it is probably much more
intuitive to use than PB_OSTREAM_SIZING itself.

This has been suggested before also, but I ended up refusing it back
them. Reconsidering it now, I see that an intuitive API is much better
than any amount of documentation explaining a non-intuitive API.

Update issue 16
Status: FixedInGit
2014-04-05 11:26:39 +03:00
Petteri Aimonen 287207841d Remove the NANOPB_INTERNALS functions from public API.
These have been deprecated since nanopb-0.1.6 (some since 0.1.3).
Equivalent functions with better interface are available in the API.

Update issue 91
Status: FixedInGit
2013-10-29 16:32:47 +02:00
Petteri Aimonen ed564186e1 Detect invalid sizes when encoding bytes fields. 2013-10-24 21:45:39 +03:00
Petteri Aimonen e83fbd18d3 Check array max size when encoding.
Update issue 90
Status: FixedInGit
2013-10-20 21:42:00 +03:00
Petteri Aimonen 388d4de833 Add #defines for the maximum encoded message size.
Update issue 89
Status: FixedInGit
2013-09-26 10:23:37 +03:00
Petteri Aimonen 262c62676c Start moving the tests into subfolders. Transition to SCons for build system for the tests.
Only a few tests updated so far. Have to include all the rest before merging to mainline.

Update issue 63
Status: Started
2013-09-08 17:52:03 +03:00