Commit Graph
130 Commits
Author SHA1 Message Date
Petteri Aimonen 19512e147c Formatting fixes 2020-10-02 17:34:32 +03:00
Petteri Aimonen 37e99b21b5 Documentation feedback form 2020-10-02 17:06:19 +03:00
Petteri Aimonen c584f1d125 Formatting fixes 2020-09-29 12:45:00 +03:00
Petteri Aimonen 6c5dd976b4 Finish docs conversion, need review still 2020-09-29 10:25:26 +03:00
Petteri Aimonen 13fe1703f7 More docs to markdown 2020-09-24 11:46:18 +03:00
Petteri Aimonen 5db07d2cf6 Begin converting docs to markdown (#587) 2020-09-24 10:29:36 +03:00
Petteri Aimonen 7e44724208 Setting version to 0.4.4-dev 2020-09-21 13:58:43 +03:00
Petteri Aimonen 7ef2758e46 Add docs about protoc --nanopb_opt (#432) 2020-09-15 16:37:38 +03:00
Petteri Aimonen 7d39f39fbe mangle_names documentation improvements (#578) 2020-09-02 18:25:44 +03:00
Petteri Aimonen 1fdc916e98 Add notes on documentation version 2020-06-25 08:17:46 +03:00
Petteri Aimonen afebd69717 Update pb_msgdesc_t definition to improve performance.
1. Include precalculated required field count and largest tag, to avoid calculating them at runtime.
2. Reorder fields for better natural alignment (pointers first in struct)
3. Remove PB_PACKED_STRUCT specification, no longer needed.
2020-06-24 13:46:47 +03:00
Petteri Aimonen bf1eb547d7 Change generator to use Python 3 by default (#441, #509).
This may break things for users that have python-protobuf installed
only for Python 2. Easiest fix is to just install python3-protobuf.

After much consideration, I think making the change now will make
life easiest for most users. There are now alternative files that
can be used if only Python 2 is available, see migration.rst.
2020-06-18 13:39:30 +03:00
Petteri Aimonen 92887f635b Remove outdated note in docs 2020-04-03 16:35:33 +03:00
Petteri Aimonen 381a277c56 Add nanopb-specific package name option (#422) 2020-01-31 21:33:32 +02:00
Petteri Aimonen 521daea85e Remove rsvg-convert rule from docs makefile (#479) 2020-01-10 12:27:58 +02:00
bolind 31ecc3ef10 Fixed image reference in documentation 2020-01-10 12:26:41 +02:00
Petteri Aimonen 8ae0178f4c Update documentation 2019-12-20 14:43:48 +02:00
Petteri Aimonen 52f539eca7 Add links 2019-12-19 11:58:34 +02:00
Petteri Aimonen 08a098498d Add to makefile 2019-12-19 11:55:09 +02:00
Petteri Aimonen 4b7b0e4eb3 Update documentation 2019-12-19 11:52:30 +02:00
Petteri Aimonen c8be762c45 Clean up generated .pb.h files a bit 2019-12-18 19:59:36 +02:00
Petteri Aimonen b9c7bbaeab Improve callback handling inside oneofs. (#175)
Removed PB_OLD_CALLBACK_STYLE. Added generator option
submsg_callback to have a message-level callback for
setting up callbacks inside oneofs. Added example/testcase
about using callbacks with oneofs.
2019-12-18 18:35:00 +02:00
Pavol Rusnak c00d4c1979 Introduce new compile time flag: PB_VALIDATE_UTF8
Check whether incoming strings are valid UTF-8 sequences. Slows down
the string processing slightly and slightly increases code size.
2019-12-17 14:36:29 +01:00
Petteri Aimonen 511b708290 Add PB_CONVERT_DOUBLE_FLOAT setting to convert doubles on AVR.
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-12-16 12:14:16 +02:00
Petteri Aimonen f721704ed8 Fix formatting 2019-11-30 06:51:49 +02:00
Petteri Aimonen a7637dc7d9 Update examples/simple docs 2019-11-30 06:50:33 +02:00
Petteri Aimonen 5c1bbdfd34 Update docs Makefile to use rsvg-convert 2019-11-21 11:18:30 +02:00
Petteri Aimonen 3e29a546db Add proto3_singular_msgs option, update tests (#308, #452)
This will be a breaking change for a lot of code using proto3 mode.
All proto3 submessages now have has_ field, that must be set to 'true' to
have the field encoded. To ease the transition, there is a generator
option proto3_singular_msgs to restore the old behavior.
2019-11-18 11:50:59 +02:00
Petteri Aimonen eab98ebbd6 Fix undefined behavior with bool fields (#434)
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-10-02 11:16:51 +03:00
T. Carl Beery 4e2c380f32 Update concepts.rst: fix typo 2019-09-10 08:52:20 -07:00
Pavol Rusnak 2e3d39d8ff Introduce new compile time flag: PB_ENCODE_ARRAYS_UNPACKED
Don't encode scalar arrays as packed. This is only to be used when
the decoder on the receiving side cannot process packed scalar arrays.
Such example is older protobuf.js.
2019-08-27 13:14:22 +02:00
Petteri Aimonen 847ac296b5 Add migration note about enum min/max 2019-06-01 09:43:55 +03:00
Petteri Aimonen e31fa8eb03 Add pb_decode_ex(), pb_encode_ex() functions.
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-25 20:37:15 +02:00
Petteri Aimonen b2d04dfcea Rename #define fieldname_default to _DEFAULT to avoid conflict with older constant.
This should make migration error messages less confusing.
2019-01-25 18:56:34 +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 abf4798454 Merge branch 'dev_0.4' 2018-11-10 21:08:55 +02:00
Petteri Aimonen c8274d6a65 Fix .options file case sensitivity on Windows. 2018-11-10 19:10:24 +02:00
Petteri Aimonen 8495e598e1 Make --no-strip-path default (#326)
This makes nanopb behaviour match protoc --cpp_out=.
2018-11-10 16:56:37 +02:00
Pei Wang 6a0df68944 Clarify the usage of callback fields inside oneof sections in the docs 2018-11-01 13:14:58 -07:00
Petteri Aimonen 2b0db997d7 More backslash escape fixes 2018-04-11 12:52:53 +03:00
Petteri Aimonen f313dee355 Fix backslash escaping in migration doc 2018-04-11 12:51:54 +03:00
Petteri Aimonen a3aae56313 Update docs about default values 2018-04-07 09:04:01 +03:00
Petteri Aimonen 589dfcab61 Add documentation note about issue #116 2018-02-20 18:07:38 +02:00
Petteri Aimonen b1e2b4396b Fix build warning in docs 2018-02-16 08:50:23 +02:00
Oliver Lee be1fd8aa75 Document fixed count option 2018-02-14 22:45:29 +01:00
Petteri Aimonen c291fee05f Add option to build without 64-bit support (issue #86) 2017-09-16 09:28:08 +03:00
Petteri Aimonen 0b5f1cbbd0 Better error message for max_size missing with fixed_length=true (issue #281) 2017-09-15 07:49:03 +03:00
Petteri Aimonen 477b49df5b Merge branch 'master' into dev_0.4 2017-07-04 15:44:20 +03:00
Petteri Aimonen 634cf35935 oneof migration note 2017-06-04 15:26:55 +03:00
Petteri Aimonen 2ac6e9762f Check CHAR_BIT before using optimized pb_decode_fixedXX() version 2017-05-05 07:34:28 +03:00