apps/agl-service-can-low-level.git
11 years agoUpdate changelog
Petteri Aimonen [Thu, 7 Feb 2013 16:06:42 +0000 (18:06 +0200)]
Update changelog

11 years agoFix error message bugs with packed arrays.
Petteri Aimonen [Thu, 7 Feb 2013 15:56:52 +0000 (17:56 +0200)]
Fix error message bugs with packed arrays.

Error messages were not propagated correctly with PB_HTYPE_ARRAY.
Error status (boolean return value) was correct.

Update issue 56
Status: FixedInGit

11 years agoAdd check for sizeof(double) == 8.
Petteri Aimonen [Thu, 7 Feb 2013 15:48:50 +0000 (17:48 +0200)]
Add check for sizeof(double) == 8.

Update issue 54
Status: FixedInGit

11 years agoSanitize filenames before putting them in #ifndef.
Petteri Aimonen [Thu, 7 Feb 2013 15:40:17 +0000 (17:40 +0200)]
Sanitize filenames before putting them in #ifndef.

Update issue 50
Status: FixedInGit

11 years agoFix compiler warning on MSVC (issue #57)
Petteri Aimonen [Thu, 7 Feb 2013 15:19:53 +0000 (17:19 +0200)]
Fix compiler warning on MSVC (issue #57)

11 years agoUse unsigned datatypes where appropriate.
Petteri Aimonen [Wed, 6 Feb 2013 20:18:52 +0000 (22:18 +0200)]
Use unsigned datatypes where appropriate.

11 years agoImprove the pb_decode_varint implementations.
Petteri Aimonen [Wed, 6 Feb 2013 20:11:02 +0000 (22:11 +0200)]
Improve the pb_decode_varint implementations.

Results for ARM: -4% execution time, +1% code size

11 years agoAvoid unnecessary looping in required fields check.
Petteri Aimonen [Wed, 6 Feb 2013 19:44:40 +0000 (21:44 +0200)]
Avoid unnecessary looping in required fields check.

Results for ARM: -6% execution time, -1% code size

11 years agoAdd compile-time option PB_BUFFER_ONLY.
Petteri Aimonen [Wed, 6 Feb 2013 18:54:25 +0000 (20:54 +0200)]
Add compile-time option PB_BUFFER_ONLY.

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.

11 years agoMake pb_decode_varint32 a separate implementation.
Petteri Aimonen [Tue, 5 Feb 2013 20:39:32 +0000 (22:39 +0200)]
Make pb_decode_varint32 a separate implementation.

This avoids doing 64-bit arithmetic for 32-bit varint decodings.
It does increase the code size somewhat.

Results for ARM Cortex-M3: -10% execution time, +1% code size, -2% ram usage.

11 years agoPerformance improvement: replace memcpy with loop.
Petteri Aimonen [Tue, 5 Feb 2013 20:06:36 +0000 (22:06 +0200)]
Performance improvement: replace memcpy with loop.

In the pb_istream_from_buffer and pb_ostream_from_buffer, memcpy was
used to transfer values to the buffer. For the common case of
count = 1-10 bytes, a simple loop is faster.

11 years agoAdd Java package name to nanopb.proto.
Petteri Aimonen [Tue, 5 Feb 2013 09:47:37 +0000 (11:47 +0200)]
Add Java package name to nanopb.proto.

This fixes problems when interoperating with Java.

Fix suggested by trepidacious:
https://groups.google.com/forum/#!topic/nanopb/hZgrj6h9OnY

11 years agoAdd an example of handling doubles on AVR platform.
Petteri Aimonen [Tue, 29 Jan 2013 20:10:37 +0000 (22:10 +0200)]
Add an example of handling doubles on AVR platform.

11 years agoFix misleading comment (current generator sets LTYPE always).
Petteri Aimonen [Mon, 21 Jan 2013 19:18:38 +0000 (21:18 +0200)]
Fix misleading comment (current generator sets LTYPE always).

11 years agoOops, typoed #ifdef; again fixing previous commit.
Petteri Aimonen [Wed, 16 Jan 2013 14:32:48 +0000 (16:32 +0200)]
Oops, typoed #ifdef; again fixing previous commit.

11 years agoPut previous commit (issue 52) inside #ifndef
Petteri Aimonen [Wed, 16 Jan 2013 14:31:45 +0000 (16:31 +0200)]
Put previous commit (issue 52) inside #ifndef

11 years agoFix bug with error messages.
Petteri Aimonen [Wed, 16 Jan 2013 14:28:51 +0000 (16:28 +0200)]
Fix bug with error messages.

Update issue 52
Status: FixedInGit

11 years agoAdd field type FT_IGNORE to generator.
Petteri Aimonen [Mon, 14 Jan 2013 15:30:49 +0000 (17:30 +0200)]
Add field type FT_IGNORE to generator.

This allows ignoring fields that are unnecessary or too large for an
embedded system using nanopb, while allowing them to remain in the .proto
for other platforms.

Update issue 51
Status: FixedInGit

11 years agoAdd a test for the backwards compatibility of generated files.
Petteri Aimonen [Sun, 13 Jan 2013 16:44:15 +0000 (18:44 +0200)]
Add a test for the backwards compatibility of generated files.

It is not necessary to maintain full compatibility of generated files
for all of eternity, but this test will warn us if there is
a need to regenerate the files.

11 years agoAdd generator option for packed structs.
Petteri Aimonen [Thu, 10 Jan 2013 15:32:27 +0000 (17:32 +0200)]
Add generator option for packed structs.

Usage is:
message Foo
{
   option (nanopb_msgopt).packed_struct = true;
   ...
}

Valid also in file scope.

Update issue 49
Status: FixedInGit

11 years agoCleanup: get rid of unnecessary spaces
Petteri Aimonen [Thu, 10 Jan 2013 15:31:33 +0000 (17:31 +0200)]
Cleanup: get rid of unnecessary spaces

11 years agoSetting version to 0.1.9-dev
Petteri Aimonen [Thu, 13 Dec 2012 19:32:37 +0000 (21:32 +0200)]
Setting version to 0.1.9-dev

11 years agoPublishing nanopb-0.1.8
Petteri Aimonen [Thu, 13 Dec 2012 19:29:57 +0000 (21:29 +0200)]
Publishing nanopb-0.1.8

11 years agoFix small error in field callback documentation.
Petteri Aimonen [Thu, 6 Dec 2012 09:13:53 +0000 (11:13 +0200)]
Fix small error in field callback documentation.

Update issue 44
Status: FixedInGit

11 years agoComplete initialization of pb_istream_t.
Jens Steinhauser [Mon, 26 Nov 2012 23:19:55 +0000 (00:19 +0100)]
Complete initialization of pb_istream_t.

Because PB_RETURN_ERROR checks if the 'errmsg' member is NULL before
assigning to it, error messages would get lost.

11 years agoUse TESTS variable to define dependencies for run_unittests
Steffen Siering [Sun, 11 Nov 2012 23:02:26 +0000 (23:02 +0000)]
Use TESTS variable to define dependencies for run_unittests

11 years agoSelect compilation options based on $(CC) in tests/Makefile.
Petteri Aimonen [Fri, 16 Nov 2012 07:51:23 +0000 (09:51 +0200)]
Select compilation options based on $(CC) in tests/Makefile.

Makes 'make CC=clang' work.

Based on patch submitted by Steffen Siering.

Update issue 40:
Status: FixedInGit

11 years agoRename test_compiles.c to test_multiple_files.c
Petteri Aimonen [Fri, 16 Nov 2012 07:33:11 +0000 (09:33 +0200)]
Rename test_compiles.c to test_multiple_files.c

11 years agoFix STATIC_ASSERT macro when using multiple .proto files.
Steffen Siering [Sun, 11 Nov 2012 22:48:21 +0000 (22:48 +0000)]
Fix STATIC_ASSERT macro when using multiple .proto files.

The __COUNTER__ macro (used for generating unique names) is at least supported
by gcc, clang and Visual Studio. With this change test_compiles.c is
compilable, since no more typedefs are redefined.

Compilers/Preprocessors not supporting __COUNTER__ error's are still possible
which are hopfully handled by the usage of __LINE__ in most sittuations.

Added unit test for the problem.

11 years agoFix naming of nested Enums with short names
Petteri Aimonen [Tue, 13 Nov 2012 22:43:51 +0000 (00:43 +0200)]
Fix naming of nested Enums with short names

11 years agoFix naming of enums when long_names=false.
Petteri Aimonen [Tue, 13 Nov 2012 22:20:44 +0000 (00:20 +0200)]
Fix naming of enums when long_names=false.

Modify test case to check that options.pb.o compiles.

Update issue 42
Status: FixedInGit

Update issue 43
Status: FixedInGit

11 years agoFix changelog
Petteri Aimonen [Sun, 11 Nov 2012 09:20:34 +0000 (11:20 +0200)]
Fix changelog

11 years agoSetting version to 0.1.8-dev
Petteri Aimonen [Sun, 11 Nov 2012 09:19:17 +0000 (11:19 +0200)]
Setting version to 0.1.8-dev

11 years agoPublishing nanopb-0.1.7
Petteri Aimonen [Sun, 11 Nov 2012 09:16:01 +0000 (11:16 +0200)]
Publishing nanopb-0.1.7

11 years agoDocument new generator options
Petteri Aimonen [Mon, 29 Oct 2012 17:33:33 +0000 (19:33 +0200)]
Document new generator options

11 years agoAdd nanopb version number to generated files.
Petteri Aimonen [Mon, 29 Oct 2012 17:15:34 +0000 (19:15 +0200)]
Add nanopb version number to generated files.

tools/set_version.sh is used to update the values.

Update issue 36
Status: FixedInGit

11 years agoAdd extern "C" to header files.
Petteri Aimonen [Mon, 29 Oct 2012 17:03:19 +0000 (19:03 +0200)]
Add extern "C" to header files.

Update issue 35
Status: FixedInGit

11 years agoAdd option to use short names for enum values.
Petteri Aimonen [Mon, 29 Oct 2012 16:55:49 +0000 (18:55 +0200)]
Add option to use short names for enum values.

Update issue 38
Status: FixedInGit

11 years agoAllow defining field type in .proto.
Petteri Aimonen [Mon, 29 Oct 2012 16:34:24 +0000 (18:34 +0200)]
Allow defining field type in .proto.

Update issue 30
Status: FixedInGit

11 years agoImprove .proto options parsing.
Petteri Aimonen [Mon, 29 Oct 2012 16:20:15 +0000 (18:20 +0200)]
Improve .proto options parsing.

Options can now be defined on command line, file, message or in field
scope.

Update issue 12
Status: Started

11 years agoUse optparse in nanopb_generator.py
Petteri Aimonen [Mon, 29 Oct 2012 15:22:02 +0000 (17:22 +0200)]
Use optparse in nanopb_generator.py

11 years agoGive names to generated structures to allow forward declaration.
Petteri Aimonen [Mon, 29 Oct 2012 14:56:45 +0000 (16:56 +0200)]
Give names to generated structures to allow forward declaration.

Update issue 39
Status: FixedInGit

11 years agoImprove the person_with_extra_field test.
Petteri Aimonen [Sun, 21 Oct 2012 18:31:20 +0000 (21:31 +0300)]
Improve the person_with_extra_field test.

Added a field after the extra field to verify it's also ok.

11 years agoRemove the "buf = NULL" => skip requirement from pb_istream_t callbacks.
Petteri Aimonen [Thu, 18 Oct 2012 16:45:28 +0000 (19:45 +0300)]
Remove the "buf = NULL" => skip requirement from pb_istream_t callbacks.

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

11 years agoAdd tests for negative values in the alltypes testcase.
Petteri Aimonen [Sun, 14 Oct 2012 09:27:08 +0000 (12:27 +0300)]
Add tests for negative values in the alltypes testcase.

11 years agoAdd buffer size check in test_decode1.c example.
Petteri Aimonen [Tue, 18 Sep 2012 13:48:43 +0000 (16:48 +0300)]
Add buffer size check in test_decode1.c example.

This check gives a better error message in case you test stuff
and have a message longer than 512 bytes.

Update issue 34
Status: FixedInGit

11 years agoEnable -Wconversion for core and fix the warnings.
Petteri Aimonen [Mon, 3 Sep 2012 14:35:14 +0000 (17:35 +0300)]
Enable -Wconversion for core and fix the warnings.

This should help avoid issue 33 in the future.

11 years agoFix build warnings on MS compilers
dch [Sun, 2 Sep 2012 20:24:19 +0000 (21:24 +0100)]
Fix build warnings on MS compilers

Update issue 33
Status: FixedInGit

11 years agoCreated a CHANGELOG file for easy reference.
Petteri Aimonen [Sun, 2 Sep 2012 17:49:08 +0000 (20:49 +0300)]
Created a CHANGELOG file for easy reference.

11 years agoClean up one (uint64_t) cast.
Petteri Aimonen [Sun, 2 Sep 2012 17:14:22 +0000 (20:14 +0300)]
Clean up one (uint64_t) cast.

11 years agoFix -Wextra warning in generated .pb.c files.
Petteri Aimonen [Sun, 2 Sep 2012 16:54:35 +0000 (19:54 +0300)]
Fix -Wextra warning in generated .pb.c files.

Compile the generated files with the same extra-strict
settings as the core, in order to detect problems in tests.

Update issue 32
Status: FixedInGit

11 years agoFix warnings with -Wcast-qual. Add test for C++ compile.
Petteri Aimonen [Sun, 26 Aug 2012 12:21:20 +0000 (15:21 +0300)]
Fix warnings with -Wcast-qual. Add test for C++ compile.

Update issue 27
Status: FixedInGit

11 years agoAdd pb_decode_noinit and use it from pb_dec_submessage.
Petteri Aimonen [Sun, 26 Aug 2012 06:56:11 +0000 (09:56 +0300)]
Add pb_decode_noinit and use it from pb_dec_submessage.

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

11 years agoAdded alltypes-testcases for optional fields and default values.
Petteri Aimonen [Sun, 26 Aug 2012 07:57:51 +0000 (10:57 +0300)]
Added alltypes-testcases for optional fields and default values.

11 years agoRevert "Add pb_decode_noinit and use it from pb_dec_submessage."
Petteri Aimonen [Sun, 26 Aug 2012 07:05:46 +0000 (10:05 +0300)]
Revert "Add pb_decode_noinit and use it from pb_dec_submessage."

The patch breaks default values inside submessage arrays (I think).
Have to add test cases and check back.

This reverts commit f1d7640fe1be0f150f604c72108ea516222c2505.

11 years agoAdd pb_decode_noinit and use it from pb_dec_submessage.
Petteri Aimonen [Sun, 26 Aug 2012 06:56:11 +0000 (09:56 +0300)]
Add pb_decode_noinit and use it from pb_dec_submessage.

This avoids double initialization when decoding nested submessages.

Update issue 28
Status: FixedInGit

11 years agoAdd note that stream callbacks must read the whole requested length.
Petteri Aimonen [Fri, 24 Aug 2012 18:32:42 +0000 (21:32 +0300)]
Add note that stream callbacks must read the whole requested length.

Fixes issue #22.

11 years agoImplement error messages in the decoder side.
Petteri Aimonen [Fri, 24 Aug 2012 18:22:20 +0000 (21:22 +0300)]
Implement error messages in the decoder side.

Update issue 7
Status: Started

11 years agoDocument pb_close_string_substream.
Petteri Aimonen [Fri, 24 Aug 2012 17:51:29 +0000 (20:51 +0300)]
Document pb_close_string_substream.

11 years agoRevert "Change the substream implementation in pb_decode."
Petteri Aimonen [Fri, 24 Aug 2012 17:43:21 +0000 (20:43 +0300)]
Revert "Change the substream implementation in pb_decode."

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.

11 years agoReorganize the field decoder interface.
Petteri Aimonen [Fri, 24 Aug 2012 17:23:25 +0000 (20:23 +0300)]
Reorganize the field decoder interface.

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

11 years agoChange the substream implementation in pb_decode.
Petteri Aimonen [Fri, 24 Aug 2012 16:35:17 +0000 (19:35 +0300)]
Change the substream implementation in pb_decode.

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.

11 years agoFix a confusing statement in a comment.
Petteri Aimonen [Fri, 24 Aug 2012 16:25:29 +0000 (19:25 +0300)]
Fix a confusing statement in a comment.

11 years agoFix casting issues
Stan Hu [Thu, 16 Aug 2012 18:29:08 +0000 (11:29 -0700)]
Fix casting issues

11 years agoDeclare warn_unused_result only on GCC >= 3.4.0.
Petteri Aimonen [Thu, 9 Aug 2012 13:15:23 +0000 (16:15 +0300)]
Declare warn_unused_result only on GCC >= 3.4.0.
Thanks to cea.max.simoes for bug report & fix.

Update issue 25
Status: FixedInGit

11 years agoFix signedness warning in example_unions.
Petteri Aimonen [Sat, 4 Aug 2012 11:34:19 +0000 (14:34 +0300)]
Fix signedness warning in example_unions.

11 years agoFix bug in decoder with packed arrays.
Petteri Aimonen [Tue, 31 Jul 2012 16:12:57 +0000 (19:12 +0300)]
Fix bug in decoder with packed arrays.

Update issue 23
Status: FixedInGit

11 years agoExtend 'alltypes' testcase to cover repeated fields.
Petteri Aimonen [Tue, 31 Jul 2012 16:10:33 +0000 (19:10 +0300)]
Extend 'alltypes' testcase to cover repeated fields.

11 years agoAdditional unsigned vs. signed fix for tag
Petteri Aimonen [Thu, 19 Jul 2012 06:05:36 +0000 (09:05 +0300)]
Additional unsigned vs. signed fix for tag

11 years agoFix an unsigned vs. signed warning on some compiler.
Petteri Aimonen [Wed, 18 Jul 2012 18:21:07 +0000 (21:21 +0300)]
Fix an unsigned vs. signed warning on some compiler.

11 years agoFixed a few compiler warnings, added check.
Petteri Aimonen [Wed, 18 Jul 2012 18:09:13 +0000 (21:09 +0300)]
Fixed a few compiler warnings, added check.

Main code is now compiled (for tests) with -pedantic -Wextra.
The test programs are not as strictly bound, but this should
improve the chances that atleast the core library compiles with
most compilers without warnings.

12 years agoFix bug with .proto without messages (again), and add a test case for it.
Petteri Aimonen [Thu, 5 Jul 2012 17:02:06 +0000 (20:02 +0300)]
Fix bug with .proto without messages (again), and add a test case for it.

12 years agoApparently some compilers don't want to automatically cast size_t to uint64_t.
Petteri Aimonen [Thu, 5 Jul 2012 15:27:07 +0000 (18:27 +0300)]
Apparently some compilers don't want to automatically cast size_t to uint64_t.

12 years agoFix some typos in __BIG_ENDIAN__ code
Petteri Aimonen [Thu, 5 Jul 2012 15:24:11 +0000 (18:24 +0300)]
Fix some typos in __BIG_ENDIAN__ code

12 years agoReplace #warning with the standard #error.
Petteri Aimonen [Thu, 5 Jul 2012 15:19:38 +0000 (18:19 +0300)]
Replace #warning with the standard #error.

12 years agoCast enum vaules to integers and cast them back where appropraite
Stan Hu [Mon, 2 Jul 2012 21:00:45 +0000 (14:00 -0700)]
Cast enum vaules to integers and cast them back where appropraite
to prevent mixed enumeration type compiler warnings

12 years agoReplace PB_MANY_FIELDS with PB_FIELD_16BIT and PB_FIELD_32BIT.
Petteri Aimonen [Sun, 1 Jul 2012 07:15:37 +0000 (10:15 +0300)]
Replace PB_MANY_FIELDS with PB_FIELD_16BIT and PB_FIELD_32BIT.

This allows more precise control over the memory use vs. field size.

12 years agoAdd PB_MANY_FIELDS option for supporting fields > 255.
Petteri Aimonen [Sat, 30 Jun 2012 16:28:49 +0000 (19:28 +0300)]
Add PB_MANY_FIELDS option for supporting fields > 255.

Add generator warning if this is necessary.
Fixes issue #14.

12 years agoWarn if PB_MAX_REQUIRED_FIELDS is not large enough.
Petteri Aimonen [Sat, 30 Jun 2012 15:23:18 +0000 (18:23 +0300)]
Warn if PB_MAX_REQUIRED_FIELDS is not large enough.

12 years agoImprove the detection of missing required fields.
Petteri Aimonen [Sat, 30 Jun 2012 15:10:08 +0000 (18:10 +0300)]
Improve the detection of missing required fields.

Now the limit of tracked fields is configurable at compile-time using
PB_MAX_REQUIRED_FIELDS. Added related test and updated documentation.

Fixes issue #18.

12 years agoFixed formatting in docs
Petteri Aimonen [Mon, 25 Jun 2012 19:17:13 +0000 (22:17 +0300)]
Fixed formatting in docs

12 years agoDocumented NANOPB_INTERNALS compilation option
Petteri Aimonen [Mon, 25 Jun 2012 19:08:05 +0000 (22:08 +0300)]
Documented NANOPB_INTERNALS compilation option

12 years agoNote about __BIG_ENDIAN__ compilation option
Petteri Aimonen [Mon, 25 Jun 2012 18:45:40 +0000 (21:45 +0300)]
Note about __BIG_ENDIAN__ compilation option

12 years agoFix error when .proto contains no Messages (e.g. just enums).
Petteri Aimonen [Wed, 20 Jun 2012 18:31:23 +0000 (21:31 +0300)]
Fix error when .proto contains no Messages (e.g. just enums).

Thanks to Paul Fertser for reporting this bug.

12 years agoAdded example on how to handle unions.
Petteri Aimonen [Sat, 16 Jun 2012 11:08:40 +0000 (14:08 +0300)]
Added example on how to handle unions.

12 years agoAdded new functions to public interface in pb_decode.h.
Petteri Aimonen [Sat, 16 Jun 2012 11:07:37 +0000 (14:07 +0300)]
Added new functions to public interface in pb_decode.h.

pb_decode_tag and pb_skip_field allow manually iterating the fields
in a message.

12 years agoFix non-constant initializer errors with some compilers.
Petteri Aimonen [Wed, 13 Jun 2012 18:43:40 +0000 (21:43 +0300)]
Fix non-constant initializer errors with some compilers.

Fixes issue #13. Thanks to Kevin Worth for reporting.

12 years agoAdd descriptor.proto into the #include exclusion list
Petteri Aimonen [Tue, 12 Jun 2012 14:51:08 +0000 (17:51 +0300)]
Add descriptor.proto into the #include exclusion list

12 years agoMerge branch 'master' of https://code.google.com/p/nanopb
Petteri Aimonen [Sat, 19 May 2012 18:25:47 +0000 (21:25 +0300)]
Merge branch 'master' of https://code.google.com/p/nanopb

12 years agoAdd better error messages in the generator when libraries cannot be imported.
Petteri Aimonen [Sat, 19 May 2012 18:25:10 +0000 (21:25 +0300)]
Add better error messages in the generator when libraries cannot be imported.
Fixes issue #5.

12 years agoFix 64-bitness warnings in the example.
Petteri Aimonen [Sat, 19 May 2012 18:15:52 +0000 (21:15 +0300)]
Fix 64-bitness warnings in the example.

Fixes issues 9 and 10.

12 years agoFixing compiler warnings, mostly related to unused parameters.
Petteri Aimonen [Wed, 18 Apr 2012 17:15:36 +0000 (20:15 +0300)]
Fixing compiler warnings, mostly related to unused parameters.

Thanks to David Hotham for the patch. Fixes issue 8.

12 years agoRefactoring the field encoder interface.
Petteri Aimonen [Thu, 1 Mar 2012 11:46:52 +0000 (13:46 +0200)]
Refactoring the field encoder interface.

Replaced the confusing pb_enc_* functions with new pb_encode_* functions that
have a cleaner interface. Updated documentation.

Got rid of the endian_copy stuff in pb_encode.c, instead using C casts to do it automatically.
This makes the code safer and also reduces binary size by about 5%.

Fixes Issue 6.

12 years agoModified nanopb_generator.py to generate includes for other .proto files.
Petteri Aimonen [Wed, 15 Feb 2012 15:34:48 +0000 (17:34 +0200)]
Modified nanopb_generator.py to generate includes for other .proto files.
Implementation was suggested by extremeblue99.
Fixes issue 4.

12 years agoFixed nanopb_generator.py to read the input file in binary mode.
Petteri Aimonen [Mon, 30 Jan 2012 08:36:17 +0000 (10:36 +0200)]
Fixed nanopb_generator.py to read the input file in binary mode.

12 years agoImproved documentation on field decoders.
Petteri Aimonen [Mon, 23 Jan 2012 16:13:26 +0000 (18:13 +0200)]
Improved documentation on field decoders.

12 years agoFixed issue 1 reported by Erik Rosen:
Petteri Aimonen [Thu, 12 Jan 2012 17:08:05 +0000 (19:08 +0200)]
Fixed issue 1 reported by Erik Rosen:
The size of non-callback bytes-fields was miscalculated, which
caused all following fields in a message to contain garbage.

Previous commit contains a testcase for this.

This fix changes the generated message description. If your protocol uses
bytes-fields, you should regenerate *.pb.c.

12 years agoAdded an encode/decode test for 'required' fields of all types.
Petteri Aimonen [Thu, 12 Jan 2012 17:06:33 +0000 (19:06 +0200)]
Added an encode/decode test for 'required' fields of all types.

12 years agoFixed a bug in the generator that caused a compiler error on sfixed32 and sfixed64...
Petteri Aimonen [Thu, 12 Jan 2012 16:10:12 +0000 (18:10 +0200)]
Fixed a bug in the generator that caused a compiler error on sfixed32 and sfixed64 fields.

12 years agoLinewrapping in license
Petteri Aimonen [Fri, 6 Jan 2012 17:04:49 +0000 (19:04 +0200)]
Linewrapping in license