aakash-sahai / nanopb

Automatically exported from code.google.com/p/nanopb
zlib License
0 stars 0 forks source link

byte field and word field #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1.My structure have string item with max length 1 byte.
2.I shuld make the second byte to store the null

may be add byte field type and word field type?

Original issue reported on code.google.com by c4simba on 21 Jun 2012 at 10:05

GoogleCodeExporter commented 9 years ago
Hi,

The size you specify with (nanopb).max_size should include the space for null 
terminator. E.g. for 1 character of data, set (nanopb).max_size = 2.

There is no 8- or 16-bit datatypes in protobuf standard, but you can store a 
single character in an integer field.

Original comment by Petteri.Aimonen on 21 Jun 2012 at 10:10

GoogleCodeExporter commented 9 years ago

Original comment by Petteri.Aimonen on 30 Jun 2012 at 3:25