Hey Chris,
How does this apply to "with" encoding options Sebastian and you worked on before? I guess that in such case, if we speak of modbus and application level byte encoding, it might be more of runtime setting which could be passed through connection options and propagated down to generated code. Since it is resolved at runtime we would not need to allocate additional fields and rely on connection/runtime context and request byte order from there.. if possible.

Cheers,
Łukasz

On 18.02.2023 17:48, Christofer Dutz wrote:
Hi all,

so in general we have the situation in which we usually have either BigEndian 
or LittleEndian encoding. Or we have dynamic encoding based on data in the 
packet itself (PROFINET). Now Ben added something I think we’ll be needing on 
other drivers too (Modbus) … that the encoding is passed in from the outside.

He solved this by passing in a custom type to the Parser and relying on this 
being saved in an artificial ParserArgument-Field.

I’m not a big fan of storing parser arguments in fields to be able to access 
them when serializing, because it sort of adds clutter to the model.

I would love to change things in a way, that if a parser argument of type 
“ByteEncoding” is defined, that this field is also automatically added to the 
serializer.

What do you folks think?

Chris


Reply via email to