X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=generator%2Fproto%2Fnanopb.proto;h=e4c1da79faa79b7e85457b1668eebb07e9e9d666;hb=278ffb890e3d8722e4c7d824baaf221a1e375fc4;hp=e830ec2ceb3a107e149c0671f9e985f53f80c63c;hpb=fa444be4243b2e1f0f6ee22798ddbf0c85e54422;p=apps%2Fagl-service-can-low-level.git diff --git a/generator/proto/nanopb.proto b/generator/proto/nanopb.proto index e830ec2c..e4c1da79 100644 --- a/generator/proto/nanopb.proto +++ b/generator/proto/nanopb.proto @@ -16,6 +16,7 @@ enum FieldType { FT_POINTER = 4; // Always generate a dynamically allocated field. FT_STATIC = 2; // Generate a static field or raise an exception if not possible. FT_IGNORE = 3; // Ignore the field completely. + FT_INLINE = 5; // Legacy option, use the separate 'fixed_length' option instead } enum IntSize { @@ -31,8 +32,13 @@ enum IntSize { // fields. message NanoPBOptions { // Allocated size for 'bytes' and 'string' fields. + // For string fields, this should include the space for null terminator. optional int32 max_size = 1; + // Maximum length for 'string' fields. Setting this is equivalent + // to setting max_size to a value of length+1. + optional int32 max_length = 14; + // Allocated number of entries in arrays ('repeated' fields) optional int32 max_count = 2; @@ -51,8 +57,29 @@ message NanoPBOptions { // accesses to variables. optional bool packed_struct = 5 [default = false]; + // Add 'packed' attribute to generated enums. + optional bool packed_enum = 10 [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]; + + // integer type tag for a message + optional uint32 msgid = 9; + + // decode oneof as anonymous union + optional bool anonymous_oneof = 11 [default = false]; + + // Proto3 singular field does not generate a "has_" flag + optional bool proto3 = 12 [default = false]; + + // Generate an enum->string mapping function (can take up lots of space). + optional bool enum_to_string = 13 [default = false]; + + // Generate bytes arrays with fixed length + optional bool fixed_length = 15 [default = false]; } // Extensions to protoc 'Descriptor' type in order to define options