DCCL v4
Loading...
Searching...
No Matches
test.proto
1// Copyright 2014-2023:
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//
9//
10// This file is part of the Dynamic Compact Control Language Library
11// ("DCCL").
12//
13// DCCL is free software: you can redistribute it and/or modify
14// it under the terms of the GNU Lesser General Public License as published by
15// the Free Software Foundation, either version 2.1 of the License, or
16// (at your option) any later version.
17//
18// DCCL is distributed in the hope that it will be useful,
19// but WITHOUT ANY WARRANTY; without even the implied warranty of
20// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21// GNU Lesser General Public License for more details.
22//
23// You should have received a copy of the GNU Lesser General Public License
24// along with DCCL. If not, see <http://www.gnu.org/licenses/>.
25syntax = "proto2";
26import "dccl/option_extensions.proto";
27package dccl.test;
28
29message EmbeddedMsg1
30{
31 option (dccl.msg).codec = "dccl.default3";
32
33 optional double val = 1 [
34 (dccl.field).min = 0,
35 (dccl.field).max = 100,
36 (dccl.field).precision = 3
37 ];
38
39 optional EmbeddedMsg2 msg = 2;
40}
41
42message EmbeddedMsg2
43{
44 optional double val = 1 [
45 (dccl.field).min = 0,
46 (dccl.field).max = 100,
47 (dccl.field).precision = 2
48 ];
49}
50
51message TestMsg
52{
53 option (dccl.msg).id = 1;
54 option (dccl.msg).max_bytes = 32;
55 option (dccl.msg).codec_version = 4;
56
57 optional double d = 1 [
58 (dccl.field).min = -100,
59 (dccl.field).max = 126,
60 (dccl.field).precision = 1,
61 (dccl.field).codec = "dccl.default3"
62 ];
63
64 repeated double d_repeat = 3
65 [(dccl.field).max_repeat = 5, (dccl.field).codec = "test.grouptest"];
66 optional EmbeddedMsg1 msg = 2;
67}
68
69message TestMsgGroup
70{
71 option (dccl.msg).id = 2;
72 option (dccl.msg).max_bytes = 32;
73 option (dccl.msg).codec_group = "test.grouptest";
74 option (dccl.msg).codec_version = 4;
75
76 optional double d = 1 [
77 (dccl.field).min = -100,
78 (dccl.field).max = 126,
79 (dccl.field).precision = 1,
80 (dccl.field).codec = "dccl.default3"
81 ];
82
83 repeated double d_repeat = 3 [(dccl.field).max_repeat = 5];
84 optional EmbeddedMsg1 msg = 2;
85}
86
87message TestMsgVersion
88{
89 option (dccl.msg).id = 3;
90 option (dccl.msg).max_bytes = 32;
91 option (dccl.msg).codec_version = 2;
92
93 optional double d = 1 [
94 (dccl.field).min = -100,
95 (dccl.field).max = 126,
96 (dccl.field).precision = 2
97 ];
98
99 repeated double d_repeat = 3 [
100 (dccl.field).min = 12.0,
101 (dccl.field).max = 13.6,
102 (dccl.field).precision = 1,
103 (dccl.field).max_repeat = 5
104 ];
105
106 optional EmbeddedMsg1 msg = 2;
107}