e7bea139577acc10cf28b0b31008215c30b79368
[apps/agl-service-can-low-level.git] / generator / nanopb.proto
1 // Custom options for defining:
2 // - Maximum size of string/bytes
3 // - Maximum number of elements in array
4 //
5 // These are used by nanopb to generate statically allocable structures
6 // for memory-limited environments.
7
8 import "google/protobuf/descriptor.proto";
9
10 enum FieldType {
11     FT_DEFAULT = 0; // Automatically decide field type, generate static field if possible.
12     FT_CALLBACK = 1; // Always generate a callback field.
13     FT_STATIC = 2; // Generate a static field or raise an exception if not possible.
14 }
15
16 message NanoPBOptions {
17   optional int32 max_size = 1;
18   optional int32 max_count = 2;
19   optional FieldType type = 3 [default = FT_DEFAULT];
20 }
21
22 // Protocol Buffers extension number registry
23 // --------------------------------                                                                                                            
24 // Project:  Nanopb                                                                                                                            
25 // Contact:  Petteri Aimonen <jpa@kapsi.fi>                                                                                                    
26 // Web site: http://kapsi.fi/~jpa/nanopb                                                                                                       
27 // Extensions: 1010 (all types)                                                                                                                
28 // --------------------------------   
29
30 extend google.protobuf.FileOptions {
31     optional NanoPBOptions nanopb_fileopt = 1010;
32 }
33
34 extend google.protobuf.MessageOptions {
35     optional NanoPBOptions nanopb_msgopt = 1010;
36 }
37
38 extend google.protobuf.FieldOptions {
39     optional NanoPBOptions nanopb = 1010;
40 }
41