1 // Copyright 2014-2023:
2 // GobySoft, LLC (2013-)
3 // Massachusetts Institute of Technology (2007-2014)
4 // Community contributors (see AUTHORS file)
6 // Toby Schneider <toby@gobysoft.org>
7 // Chris Murphy <cmurphy@aphysci.com>
10 // This file is part of the Dynamic Compact Control Language Library
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.
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.
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/>.
26 import "dccl/option_extensions.proto";
29 message EmbeddedMsgOptional
31 optional double val = 1 [
33 (dccl.field).max = 126,
34 (dccl.field).precision = 3
38 message EmbeddedMsgRequired
40 required double val = 1 [
42 (dccl.field).max = 126,
43 (dccl.field).precision = 3
49 option (dccl.msg).id = 1;
50 option (dccl.msg).max_bytes = 32;
51 option (dccl.msg).codec_version = 4;
53 optional EmbeddedMsgOptional msg1 = 1;
54 repeated EmbeddedMsgOptional msg1_repeat = 3 [(dccl.field).max_repeat = 5];
56 // in DCCL v2, these will always be set upon receipt since it has required
57 // children. This test validates the fix in v3
58 optional EmbeddedMsgRequired msg2 = 2;
59 repeated EmbeddedMsgRequired msg2_repeat = 4 [(dccl.field).max_repeat = 5];