DCCL v4
test.proto
1 // Copyright 2019-2023:
2 // GobySoft, LLC (2013-)
3 // Community contributors (see AUTHORS file)
4 // File authors:
5 // Toby Schneider <toby@gobysoft.org>
6 //
7 //
8 // This file is part of the Dynamic Compact Control Language Library
9 // ("DCCL").
10 //
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.
15 //
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.
20 //
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/>.
23 syntax = "proto2";
24 import "dccl/option_extensions.proto";
25 
26 package dccl.test;
27 
28 message TestMsg
29 {
30  option (dccl.msg).id = 2;
31  option (dccl.msg).max_bytes = 64;
32  option (dccl.msg).codec_version = 4;
33 
34  // test default enc/dec
35  required double d = 1 [
36  (dccl.field).min = -100,
37  (dccl.field).max = 126,
38  (dccl.field).precision = 2,
39  (dccl.field).in_head = true
40  ];
41  optional int32 i = 3 [(dccl.field).min = -20, (dccl.field).max = 3000];
42  optional string s2 = 13
43  [(dccl.field).max_length = 8, (dccl.field).codec = "dccl.default2"];
44  optional string s = 14 [(dccl.field).max_length = 8];
45  optional bytes b = 15 [(dccl.field).max_length = 9];
46  optional bytes vb = 16
47  [(dccl.field).max_length = 9, (dccl.field).codec = "dccl.var_bytes"];
48 
49  repeated int32 ri = 17 [
50  (dccl.field).min = -20,
51  (dccl.field).max = 3000,
52  (dccl.field).max_repeat = 3
53  ];
54 }