size Layer
Last updated
Was this helpful?
Last updated
Was this helpful?
The <size> layer represents remaining serialization length of the until the end of . The definition must NOT contain more than one <size> layer.
Some protocols may specify that the field of the <size> layer contains its own length as well. The CommsDSL allows implementation of such case by adding usage of serOffset property to the field of the <size> layer.
The example below implements ID (2 bytes) | SIZE (2 bytes) | PAYLOAD
framing where SIZE
value includes length of the header (ID
+ SIZE
) in addition to the length of PAYLOAD
.
Also NOTE that <size> layer specifies number of remaining bytes until the end of layer. There are protocols that append some kind of after the payload. In order to include them in the value of the <size> layer, also use serOffset property.
The <size> layer doesn't have any extra properties in addition to ones.