Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nanopb/nanopb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-25Always include pb_release() as function, instead of macro. (#802)Petteri Aimonen
This fixes a problem with cmock, and additionally ensures that pb_release() doesn't accidentally end up as no-op if user code is compiled with wrong flags.
2020-08-07Add no-op pb_release() define when PB_ENABLE_MALLOC is not usedPetteri Aimonen
2020-06-22pb_istream_from_buffer: Update comments to avoid a common mistakePetteri Aimonen
Previously it wasn't quite clear that bufsize should be the actual length of the message, not full buffer size.
2019-12-16Add PB_CONVERT_DOUBLE_FLOAT setting to convert doubles on AVR.Petteri Aimonen
This is easier to use than the old method of separate conversion functions. More importantly, it should allow running the same tests on AVR target.
2019-11-09Make constants in header files unsigned, to prevent warnings when used in ↵Torfinn Berset
binary bitwise expressions.
2019-10-02Fix undefined behavior with bool fields (#434)Petteri Aimonen
Previously nanopb didn't enforce that decoded bool fields had valid true/false values. This could lead to undefined behavior in user code. This has potential security implications when 1) message contains bool field (has_ fields are safe) and 2) user code uses ternary operator dependent on the field value, such as: int value = msg.my_bool ? 1234 : 0 and 3) the value returned from ternary operator affects a memory access, such as: data_array[value] = 9999
2019-01-25Add pb_decode_ex(), pb_encode_ex() functions.Petteri Aimonen
This should simplify specifying combinations, so that we don't need every variant of pb_decode_noinit_delimited() etc. Also disables zero-terminated decoding in pb_decode (issue #278).
2019-01-25New field descriptor format.Petteri Aimonen
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.
2017-09-18Added pb_decode_delimited_noinitElco Jacobs
I added API function to receive delimited data without initizializing the target structure. This is useful for partial updates.
2017-09-16Add pb_en/decode_nullterminated() (part of #278)Petteri Aimonen
Nanopb has traditionally supported messages to be terminated with a zero tag. However, this is not really standard protobuf behaviour, so it makes sense to separate it into a different function. Because it is a breaking change, it will happen in 0.4.0 release. But I add the functions here early so that new code can start using them now. Also changed the network_server example to use en/decode_delimited(), which is the more common protobuf method of simple message framing.
2017-09-16Add option to build without 64-bit support (issue #86)Petteri Aimonen
2017-01-12Fix closing a non-empty substream resulting in an incorrect stream stateTobba
2016-12-23Make pb_decode_varint32 public APITobba
2016-01-27Replace uint8_t with a pb_byte_t typedef.Petteri Aimonen
This supports platforms where uint8_t does not exist. If you are using a custom pb_syshdr.h, this may require adding definitions for uint_least8_t etc.
2015-12-16pb_istream_from_buffer: add const to prototypeAndrew Ruder
This commit changes the prototype for pb_istream_from_buffer from: pb_istream_t pb_istream_from_buffer(uint8_t *buf, size_t bufsize); to pb_istream_t pb_istream_from_buffer(const uint8_t *buf, size_t bufsize); This allows pb_istream_from_buffer users to point to const buffers without having to inspect code (to ensure practical const-ness) and then be forced to manually cast away const. In order to not break compatibility with existing programs (by introducing a const/non-const union in the pb_istream_t state) we simply cast away the const in pb_istream_from_buffer and re-apply it when possible in the callbacks. Unfortunately we lose any compiler help in the callbacks to ensure we are treating the buffer as const but manual inspection is easy enough.
2014-08-18Rename poorly named identifier to avoid name conflicts.Petteri Aimonen
Update issue 106 Status: FixedInGit
2014-03-16Documentation updatesPetteri Aimonen
2014-03-12Add pb_release() functionPetteri Aimonen
2013-10-29Remove the NANOPB_INTERNALS functions from public API.Petteri Aimonen
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-09-09Move the declarations of _pb_ostream_t and _pb_istream_t before first use.Petteri Aimonen
Otherwise Microsoft Visual C++ threats them as C++ classes instead of plain structs, forbidding use in C linkage functions. Thanks to Markus Schwarzenberg for the patch. Update issue 84 Status: Started
2013-07-06Add pb_decode_delimited and pb_encode_delimited wrapper functions.Petteri Aimonen
Update issue 74 Status: FixedInGit
2013-07-06Clean up the comments in pb_encode.h and pb_decode.hPetteri Aimonen
2013-04-08No need to include stdbool.h separatelydch
2013-02-06Add compile-time option PB_BUFFER_ONLY.Petteri Aimonen
This allows slight optimizations if only memory buffer support (as opposed to stream callbacks) is wanted. On ARM difference is -12% execution time, -4% code size when enabled.
2012-10-29Add extern "C" to header files.Petteri Aimonen
Update issue 35 Status: FixedInGit
2012-10-18Remove the "buf = NULL" => skip requirement from pb_istream_t callbacks.Petteri Aimonen
Rationale: it's easy to implement the callback wrong. Doing so introduces io errors when unknown fields are present in the input. If code is not tested with unknown fields, these bugs can remain hidden for long time. Added a special case for the memory buffer stream, where it gives a small speed benefit. Added testcase for skipping fields with test_decode2 implementation. Update issue 37 Status: FixedInGit
2012-08-26Add pb_decode_noinit and use it from pb_dec_submessage.Petteri Aimonen
This avoids double initialization when decoding nested submessages. Fixes an issue with submessage arrays that was present in previous version of this patch. Update issue 28 Status: FixedInGit
2012-08-26Revert "Add pb_decode_noinit and use it from pb_dec_submessage."Petteri Aimonen
The patch breaks default values inside submessage arrays (I think). Have to add test cases and check back. This reverts commit f1d7640fe1be0f150f604c72108ea516222c2505.
2012-08-26Add pb_decode_noinit and use it from pb_dec_submessage.Petteri Aimonen
This avoids double initialization when decoding nested submessages. Update issue 28 Status: FixedInGit
2012-08-24Implement error messages in the decoder side.Petteri Aimonen
Update issue 7 Status: Started
2012-08-24Revert "Change the substream implementation in pb_decode."Petteri Aimonen
This reverts commit dc2da0edc568b29361479fb7405c96b1a13442cf. Add pb_close_string_substream() for copying back the state. This makes adding error messages easier in the future, as also them need to be propagated back from the substream.
2012-08-24Reorganize the field decoder interface.Petteri Aimonen
This makes the field decoding functions more intuitive to use. The old interface is still present if you specify NANOPB_INTERNALS. Update issue 2 Status: FixedInGit
2012-08-24Change the substream implementation in pb_decode.Petteri Aimonen
This makes it unnecessary to copy back the state, and also relaxes the requirements on callbacks (bytes_left will always be valid). It decreases code size by a few bytes, but may be just slightly slower.
2012-08-24Fix a confusing statement in a comment.Petteri Aimonen
2012-07-18Fix an unsigned vs. signed warning on some compiler.Petteri Aimonen
2012-06-16Added new functions to public interface in pb_decode.h.Petteri Aimonen
pb_decode_tag and pb_skip_field allow manually iterating the fields in a message.
2011-09-13Fixed a bunch of bugs related to callback fields.Petteri Aimonen
Most importantly, callback fields in submessages were being overwritten with garbage, causing segfaults. Additionally, converted PB_LTYPE_FIXED to PB_LTYPE_FIXED32 and PB_LTYPE_FIXED64. This makes the interface a bit easier to use, and in addition runs faster. git-svn-id: https://svn.kapsi.fi/jpa/nanopb@975 e3a754e5-d11d-0410-8d38-ebb782a927b9
2011-08-15More documentation, small improvementsPetteri Aimonen
git-svn-id: https://svn.kapsi.fi/jpa/nanopb@955 e3a754e5-d11d-0410-8d38-ebb782a927b9
2011-08-04EncoderPetteri Aimonen
git-svn-id: https://svn.kapsi.fi/jpa/nanopb@951 e3a754e5-d11d-0410-8d38-ebb782a927b9
2011-07-28git-svn-id: https://svn.kapsi.fi/jpa/nanopb@947 ↵Petteri Aimonen
e3a754e5-d11d-0410-8d38-ebb782a927b9
2011-07-27Making code ansi-compatiblePetteri Aimonen
git-svn-id: https://svn.kapsi.fi/jpa/nanopb@944 e3a754e5-d11d-0410-8d38-ebb782a927b9
2011-07-27Improvements, array supportPetteri Aimonen
git-svn-id: https://svn.kapsi.fi/jpa/nanopb@943 e3a754e5-d11d-0410-8d38-ebb782a927b9
2011-07-26First version of decodingPetteri Aimonen
git-svn-id: https://svn.kapsi.fi/jpa/nanopb@942 e3a754e5-d11d-0410-8d38-ebb782a927b9