Skip to content

Struct wfm_field_t

ClassList > wfm_field_t

One field of a frame — a run of bits that appears on the wire. More...

  • #include <wfm_frame.h>

Public Attributes

Type Name
size_t bits
unsigned derived_by
char name
size_t reps
wfm_seq_t seq

Detailed Description

Either the caller supplies the bits (seq, any wfm_seq_kind_t) or a stage produces them (derived_by non-zero: a CRC trailer, a block of Reed-Solomon check symbols). Both are fields, because both are on the wire, and making the second one a field is what removes the need for a stage to expand the field it covers.

Public Attributes Documentation

variable bits

size_t wfm_field_t::bits;

derived only: length in bits, sized by its stage


variable derived_by

unsigned wfm_field_t::derived_by;

0 when the caller supplies this field; otherwise the index of the producing stage, plus one. The +1 is so a zero-initialised field is a caller-supplied one rather than silently the output of stage 0.


variable name

char wfm_field_t::name[WFM_FRAME_NAME_MAX];

What this field is called, "" when the caller did not say.

OPTIONAL, and everything keeps working without it: a field is still addressed by index, and a zero-initialised description is still a valid one. What a name buys is the other direction — a receiver slicing a capture asks for "payload" rather than for field 2, and a stage's cover reads as a pair of names rather than a pair of offsets into a list the reader has to hold in their head.

That is not a cosmetic difference. derived_by, first_field and n_fields are all INDICES into this array, which is precisely why a frame's every parameter has to be passed positionally, and why frame_create() takes 38 arguments.

A fixed array rather than a pointer, so the description stays a POD that can be copied, compared and stack-allocated — the property the whole representation depends on.


variable reps

size_t wfm_field_t::reps;

repetitions of seq, verbatim; 0 means one


variable seq

wfm_seq_t wfm_field_t::seq;

the bits, when the caller supplies them



The documentation for this class was generated from the following file native/inc/wfm/wfm_frame.h