GobySoft / dccl

Dynamic Compact Control Language
Other
17 stars 13 forks source link

Feature: max_bytes runtime conditional (to support different channel types) #87

Open tsaubergine opened 1 year ago

tsaubergine commented 1 year ago

On 9/21/22 19:57, Fenucci, Davide wrote:

I saw your recent DCCL update about dynamic conditions - that looks awesome, and I was wondering if we could use it to achieve the following. We have a message with a repeated field for which we set the max_repeat attribute to fit in the max_bytes of the message - consider the following message as a minimal example:

message Test { option (dccl.msg) = { id: 2, max_bytes: 82, codec_version: 4 };

repeated uint32 field = 1 [ (dccl.field) = { min: 0 max: 4294967295 max_repeat: 20 } ]; }

Now, what we would like to do is to send the same message over different communication channels having different length constraints (WiFi, acoustic and Iridium, in particular) - do you think it would make sense to dynamically adjust the max_bytes and max_repeat attributes based on the value of a field that will contain the type of channel used? Say something along the lines of the following:

message Test { option (dccl.msg) = { id: 2, max_bytes: 82, codec_version: 4 dynamic_conditions: { max_bytes: "if this.channel == "WiFi"; then return 1000000; else if this.channel == "Acoustic"; then return 60; ... end" } };