DCCL v5
Loading...
Searching...
No Matches
test.proto
1// Copyright 2024:
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// tests CRC field codecs (dccl.crc16 and dccl.crc32)
24
25syntax = "proto2";
26
27import "dccl/option_extensions.proto";
28
29package dccl.test;
30
31// Test message with CRC-16 checksum
32message TestCRC16
33{
34 option (dccl.msg).id = 10;
35 option (dccl.msg).max_bytes = 32;
36 option (dccl.msg).codec_version = 5;
37
38 required int32 x = 1 [(dccl.field) = { min: -10000, max: 10000 }];
39 required int32 y = 2 [(dccl.field) = { min: -10000, max: 10000 }];
40 required uint32 crc = 100 [
41 (dccl.field) = { codec: "dccl.crc16" }
42 ];
43}
44
45// Test message with CRC-32 checksum
46message TestCRC32
47{
48 option (dccl.msg).id = 11;
49 option (dccl.msg).max_bytes = 32;
50 option (dccl.msg).codec_version = 5;
51
52 required int32 x = 1 [(dccl.field) = { min: -10000, max: 10000 }];
53 required int32 y = 2 [(dccl.field) = { min: -10000, max: 10000 }];
54 required uint32 crc = 100 [
55 (dccl.field) = { codec: "dccl.crc32" }
56 ];
57}