DCCL v5
Loading...
Searching...
No Matches
test.proto
1syntax = "proto2";
2
3import "dccl/option_extensions.proto";
4
5package dccl.test;
6
7// Message that uses dynamic_conditions.max_bytes to enforce per-channel limits.
8// The static max_bytes (200) is the absolute upper bound; dynamic_conditions.max_bytes
9// can further restrict encoding based on a channel field at runtime.
10message TestMaxBytes
11{
12 option (dccl.msg) = {
13 id: 10,
14 max_bytes: 200,
15 codec_version: 5,
16 dynamic_conditions: {
17 max_bytes: "if this.channel == 'ACOUSTIC' then return 10 else return 200 end"
18 }
19 };
20
21 enum Channel
22 {
23 WIFI = 1;
24 ACOUSTIC = 2;
25 IRIDIUM = 3;
26 }
27
28 required Channel channel = 1;
29
30 repeated uint32 data = 2 [(dccl.field) = { min: 0 max: 4294967295 max_repeat: 20 }];
31}