X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=generator%2Fproto%2Fnanopb.proto;h=a1b24936c445b371f3303cd9e88a4dd1ccbe2383;hb=8d12fecc7e4fb6899eb0d013abe0d6a5e03447ce;hp=2be2f8037983165dcd583c1959e3f2d12c1460b9;hpb=356535da9bd79252e5365a6e5648b7fcd28b367c;p=apps%2Fagl-service-can-low-level.git diff --git a/generator/proto/nanopb.proto b/generator/proto/nanopb.proto index 2be2f803..a1b24936 100644 --- a/generator/proto/nanopb.proto +++ b/generator/proto/nanopb.proto @@ -5,6 +5,7 @@ // These are used by nanopb to generate statically allocable structures // for memory-limited environments. +syntax = "proto2"; import "google/protobuf/descriptor.proto"; option java_package = "fi.kapsi.koti.jpa.nanopb"; @@ -17,6 +18,14 @@ enum FieldType { FT_IGNORE = 3; // Ignore the field completely. } +enum IntSize { + IS_DEFAULT = 0; // Default, 32/64bit based on type in .proto + IS_8 = 8; + IS_16 = 16; + IS_32 = 32; + IS_64 = 64; +} + // This is the inner options message, which basically defines options for // a field. When it is used in message or file scope, it applies to all // fields. @@ -27,6 +36,10 @@ message NanoPBOptions { // Allocated number of entries in arrays ('repeated' fields) optional int32 max_count = 2; + // Size of integer fields. Can save some memory if you don't need + // full 32 bits for the value. + optional IntSize int_size = 7 [default = IS_DEFAULT]; + // Force type of field (callback or static allocation) optional FieldType type = 3 [default = FT_DEFAULT]; @@ -37,6 +50,12 @@ message NanoPBOptions { // Note: this cannot be used on CPUs that break on unaligned // accesses to variables. optional bool packed_struct = 5 [default = false]; + + // Skip this message + optional bool skip_message = 6 [default = false]; + + // Generate oneof fields as normal optional fields instead of union. + optional bool no_unions = 8 [default = false]; } // Extensions to protoc 'Descriptor' type in order to define options