2 // GobySoft, LLC (2013-)
3 // Community contributors (see AUTHORS file)
5 // Toby Schneider <toby@gobysoft.org>
8 // This file is part of the Dynamic Compact Control Language Library
11 // DCCL is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU Lesser General Public License as published by
13 // the Free Software Foundation, either version 2.1 of the License, or
14 // (at your option) any later version.
16 // DCCL is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU Lesser General Public License for more details.
21 // You should have received a copy of the GNU Lesser General Public License
22 // along with DCCL. If not, see <http://www.gnu.org/licenses/>.
25 import "dccl/option_extensions.proto";
31 optional double val = 1 [
33 (dccl.field).max = 126,
34 (dccl.field).precision = 3
40 option (dccl.msg).id = 2;
41 option (dccl.msg).max_bytes = 32;
42 option (dccl.msg).codec_version = 4;
52 [default = 1.5, (dccl.field) = { min: 0, max: 10, precision: 1 }];
56 double double_oneof1 = 118 [
57 (dccl.field).min = -100,
58 (dccl.field).max = 126,
59 (dccl.field).precision = 2
62 EmbeddedMsg1 msg_oneof1 = 119;
67 int32 int32_oneof2 = 120
68 [(dccl.field).min = -20, (dccl.field).max = 3000];
69 EmbeddedMsg1 msg_oneof2 = 121;
72 optional uint32 hash_opt = 200 [
73 (dccl.field).codec = "dccl.hash",
74 (dccl.field).max = 0xFFFF // 16 bits
76 required uint32 hash_req = 201 [
77 (dccl.field).codec = "dccl.hash",
78 (dccl.field).max = 0xFFFFFFFF // 32 bits
82 message TestMsgNoHashableChanges
84 option (dccl.msg).id = 2;
85 option (dccl.msg).max_bytes = 64;
86 option (dccl.msg).codec_version = 4;
96 [default = 2.5, (dccl.field) = { min: 0, max: 10, precision: 1 }];
100 double double_oneof1 = 118 [
101 (dccl.field).min = -100,
102 (dccl.field).max = 126,
103 (dccl.field).precision = 2
106 EmbeddedMsg1 msg_oneof1 = 119;
111 int32 int32_oneof2 = 120
112 [(dccl.field).min = -20, (dccl.field).max = 3000];
113 EmbeddedMsg1 msg_oneof2 = 121;
115 optional uint32 hash_opt = 200 [
116 (dccl.field).codec = "dccl.hash",
117 (dccl.field).max = 0xFFFF // 16 bits
119 required uint32 hash_req = 201 [
120 (dccl.field).codec = "dccl.hash",
121 (dccl.field).max = 0xFFFFFFFF // 32 bits
127 option (dccl.msg).id = 3;
128 option (dccl.msg).max_bytes = 32;
129 option (dccl.msg).codec_version = 4;
138 optional double d = 6
139 [default = 1.5, (dccl.field) = { min: 0, max: 10, precision: 1 }];
143 double double_oneof1 = 118 [
144 (dccl.field).min = -100,
145 (dccl.field).max = 126,
146 (dccl.field).precision = 2
149 EmbeddedMsg1 msg_oneof1 = 119;
154 int32 int32_oneof2 = 120
155 [(dccl.field).min = -20, (dccl.field).max = 3000];
156 EmbeddedMsg1 msg_oneof2 = 121;
158 optional uint32 hash_opt = 200 [
159 (dccl.field).codec = "dccl.hash",
160 (dccl.field).max = 0xFFFF // 16 bits
162 required uint32 hash_req = 201 [
163 (dccl.field).codec = "dccl.hash",
164 (dccl.field).max = 0xFFFFFFFF // 32 bits
168 message TestMsgNewEnum
170 option (dccl.msg).id = 2;
171 option (dccl.msg).max_bytes = 32;
172 option (dccl.msg).codec_version = 4;
182 optional double d = 6
183 [default = 1.5, (dccl.field) = { min: 0, max: 10, precision: 1 }];
187 double double_oneof1 = 118 [
188 (dccl.field).min = -100,
189 (dccl.field).max = 126,
190 (dccl.field).precision = 2
193 EmbeddedMsg1 msg_oneof1 = 119;
198 int32 int32_oneof2 = 120
199 [(dccl.field).min = -20, (dccl.field).max = 3000];
200 EmbeddedMsg1 msg_oneof2 = 121;
202 optional uint32 hash_opt = 200 [
203 (dccl.field).codec = "dccl.hash",
204 (dccl.field).max = 0xFFFF // 16 bits
206 required uint32 hash_req = 201 [
207 (dccl.field).codec = "dccl.hash",
208 (dccl.field).max = 0xFFFFFFFF // 32 bits
212 message TestMsgNewBounds
214 option (dccl.msg).id = 2;
215 option (dccl.msg).max_bytes = 32;
216 option (dccl.msg).codec_version = 4;
225 optional double d = 6
226 [default = 1.5, (dccl.field) = { min: -1, max: 10, precision: 1 }];
230 double double_oneof1 = 118 [
231 (dccl.field).min = -100,
232 (dccl.field).max = 126,
233 (dccl.field).precision = 2
236 EmbeddedMsg1 msg_oneof1 = 119;
241 int32 int32_oneof2 = 120
242 [(dccl.field).min = -20, (dccl.field).max = 3000];
243 EmbeddedMsg1 msg_oneof2 = 121;
246 optional uint32 hash_opt = 200 [
247 (dccl.field).codec = "dccl.hash",
248 (dccl.field).max = 0xFFFF // 16 bits
250 required uint32 hash_req = 201 [
251 (dccl.field).codec = "dccl.hash",
252 (dccl.field).max = 0xFFFFFFFF // 32 bits
258 option (dccl.msg).id = 2;
259 option (dccl.msg).max_bytes = 32;
260 option (dccl.msg).codec_version = 2;
269 optional double d = 6
270 [default = 1.5, (dccl.field) = { min: 0, max: 10, precision: 1 }];
275 option (dccl.msg).id = 2;
276 option (dccl.msg).max_bytes = 32;
277 option (dccl.msg).codec_version = 3;
286 optional double d = 6
287 [default = 1.5, (dccl.field) = { min: 0, max: 10, precision: 1 }];
292 option (dccl.msg).id = 2;
293 option (dccl.msg).max_bytes = 32;
294 option (dccl.msg).codec_version = 4;
303 optional double d = 6
304 [default = 1.5, (dccl.field) = { min: 0, max: 10, precision: 1 }];
307 message TestMsgMultiHash
309 option (dccl.msg).id = 3;
310 option (dccl.msg).max_bytes = 32;
311 option (dccl.msg).codec_version = 4;
313 // selection of odd sized hashes
315 optional uint32 hash4 = 1
316 [(dccl.field).codec = "dccl.hash", (dccl.field).max = 0xF];
318 optional uint32 hash6 = 2
319 [(dccl.field).codec = "dccl.hash", (dccl.field).max = 0x3F];
321 optional uint32 hash8 = 3
322 [(dccl.field).codec = "dccl.hash", (dccl.field).max = 0xFF];
324 optional uint32 hash13 = 4
325 [(dccl.field).codec = "dccl.hash", (dccl.field).max = 0x1FFF];
327 optional uint32 hash26 = 5
328 [(dccl.field).codec = "dccl.hash", (dccl.field).max = 0X3ffffff];
331 message TestMsgHashMaxTooLarge
333 option (dccl.msg).id = 3;
334 option (dccl.msg).max_bytes = 32;
335 option (dccl.msg).codec_version = 4;
338 optional uint32 hash34 = 1
339 [(dccl.field).codec = "dccl.hash", (dccl.field).max = 17179869183];