JaiaBot  1.20.0
JaiaBot micro-AUV software
option_extensions.proto
Go to the documentation of this file.
1 // Copyright 2010-2022:
2 // GobySoft, LLC (2013-)
3 // Massachusetts Institute of Technology (2007-2014)
4 // Community contributors (see AUTHORS file)
5 // File authors:
6 // Toby Schneider <toby@gobysoft.org>
7 // Chris Murphy <cmurphy@aphysci.com>
8 // Davide Fenucci <davfen@noc.ac.uk>
9 //
10 //
11 // This file is part of the Dynamic Compact Control Language Library
12 // ("DCCL").
13 //
14 // DCCL is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU Lesser General Public License as published by
16 // the Free Software Foundation, either version 2.1 of the License, or
17 // (at your option) any later version.
18 //
19 // DCCL is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU Lesser General Public License for more details.
23 //
24 // You should have received a copy of the GNU Lesser General Public License
25 // along with DCCL. If not, see <http://www.gnu.org/licenses/>.
26 syntax = "proto2";
27 
28 import "google/protobuf/descriptor.proto";
29 
30 // Email from liujisi@google.com on 10.02.2012: Feel free to use 1012 for all
31 // types of options.
32 //--------------------------------
33 // Project: Dynamic Compact Control Language
34 // Contact: Toby Schneider <tes@mit.edu>
35 // Web site: https://launchpad.net/dccl
36 // Extensions: 1012 (all types)
37 //--------------------------------
38 package dccl;
39 
40 extend .google.protobuf.FieldOptions
41 {
42  optional DCCLFieldOptions field = 1012;
43 }
44 
45 extend .google.protobuf.MessageOptions
46 {
47  optional DCCLMessageOptions msg = 1012;
48 }
49 
50 message DCCLFieldOptions
51 {
52  // what encoder / decoder should we use?
53  optional string codec = 1 [default = "dccl.default2"];
54  // leave this field out of DCCL transmissions (has_field() will be false on
55  // receipt)
56  optional bool omit = 2 [default = false];
57  // set true for fields in the header (will *not* be encrypte)d
58  optional bool in_head = 3 [default = false];
59 
60  // double, float
61  optional int32 precision = 4 [default = 0]; // Deprecated
62  optional double resolution = 12 [default = 1];
63  // int, double, float
64  optional double min = 5;
65  optional double max = 6;
66 
67  // time ("1 day" can encode times 12h before or after the receiver's time)
68  optional uint32 num_days = 7 [default = 1];
69 
70  // static
71  optional string static_value = 8 [default = ""];
72 
73  // string, bytes
74  optional uint32 max_length = 9;
75 
76  // any `repeated` field
77  optional uint32 max_repeat = 10;
78  optional uint32 min_repeat = 13 [default = 0];
79 
80  // enum
81  optional bool packed_enum = 11 [default = true];
82 
83  optional string description = 20;
84 
85  message Units
86  {
87  // units
88  optional string base_dimensions = 1;
89  optional string derived_dimensions = 2;
90  optional string system = 3 [default = "si"];
91  optional bool relative_temperature = 4 [default = false];
92  optional string unit = 5;
93  optional string prefix = 6;
94  }
95  optional Units units = 30;
96 
97  // runtime contents-based conditionals
98  message Conditions
99  {
100  optional string required_if = 1;
101  optional string omit_if = 2;
102  optional string only_if = 3;
103  optional string min = 10;
104  optional string max = 11;
105  }
106 
107  optional Conditions dynamic_conditions = 40;
108 
109  // ccl = 1000
110  // arithmetic = 1001
111  extensions 1000 to max;
112 }
113 
114 message DCCLMessageOptions
115 {
116  optional int32 id = 1;
117  optional uint32 max_bytes = 2;
118 
119  optional string codec = 3;
120 
121  optional string codec_group = 4;
122  optional int32 codec_version = 5;
123 
124  optional bool omit_id = 10 [default = false];
125 
126  optional string unit_system = 30 [default = "si"];
127 }