You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nanopb
Hi,
We have the software that works with 0.3.2 nanopb version, and upgrading to 0.4.9.1 it is not working.
We generated the pb.c and pb.h files by using nanopb-generator, and we have structures in the pb.h file as an example as below
typedef struct _code{
bool has_Id1;
uint32_t id1;
bool has_id2;
uint32_t id2;
}code; When we use the structure as it is, it works.
For optimization purposes, we reorganized the above structure as below
typedef struct _code{
uint32_t id1; uint32_t id2; bool has_Id1;
bool has_id2;
}code;
After optimization, it works in 0.3.2 and fails in 0.4.9.1.
Please suggest, for reordering the structure members, is anything to be modifed in the generated files from nanopb
Petteri Aimonen
unread,
Apr 23, 2025, 6:37:28 AMApr 23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nan...@googlegroups.com
Hi,
This is not something that is covered by the tests.
I think it will work with 0.4.x if you either edit .pb.c to contain
PB_BIND(...., 4)
or define generator option "descriptorsize = DS_4" which will do the same.
It's limited to max 128 byte distance between the field and its
boolean, but that is the same as 0.3.x with default settings.