DCCL v3
test.proto
1 
2 import "dccl/option_extensions.proto";
3 
4 package dccl.test;
5 
6 enum Enum
7 {
8  ENUM2_A = -2; // for completeness, though negative values are discouraged
9  ENUM2_B = 0;
10  ENUM2_C = 1;
11  ENUM2_D = 2;
12  ENUM2_E = 10;
13  ENUM2_F = 11;
14  ENUM2_G = 12;
15  ENUM2_H = 16777213; // Many skipped values - packed will be 3b, unpacked 24b
16 }
17 
18 message TestMsgPack
19 {
20  option (dccl.msg).id = 2;
21  option (dccl.msg).max_bytes = 2;
22  option (dccl.msg).codec_version = 3;
23 
24  required int32 five_bit_padding = 1 [(dccl.field) = {min: 0, max: 31}]; // 5b padding.
25  required Enum value = 2 [(dccl.field).packed_enum=true];
26 }
27 
28 message TestMsgUnpack
29 {
30  option (dccl.msg).id = 3;
31  option (dccl.msg).max_bytes = 4;
32  option (dccl.msg).codec_version = 3;
33 
34  required Enum value = 1 [(dccl.field).packed_enum=false];
35 }
36