WiFiCx message structure

WiFiCx command messages are based off of the previous WDI model commands.

All Wi-Fi command messages must start with a WDI_MESSAGE_HEADER structure. The command header is followed by zero or more type-length-value (TLV) structures.

The command message IDs defined for messages sent from the host to the Wi-Fi device are documented in WiFiCx Task OIDs, WiFiCx Property OIDs, and WiFiCx status indications.

TLVs

The structure of TLVs is defined in the following table. The data in TLVs is in little-endian byte order.

Field Type Description
Type UINT16 The type of the TLV structure. Unrecognized TLV types must be skipped without triggering errors.
Length of the Value buffer UINT16 The size of the Value buffer in bytes.
Value BYTE[*] The payload buffer, which may contain a structure, a list of structures, or other TLVs. If there is more data than expected in a TLV, the additional data should be skipped without triggering errors.

There are two types of TLV groupings: statically sized TLV lists, and multi-TLV groups.

Statically sized TLV lists

Statically-sized TLV lists contain several statically sized members. They are analogous to standard C-style arrays.

In this example, WDI_TLV_UNICAST_ALGORITHM_LIST is defined as a list of WDI_ALGO_PAIRS.

Type: WDI_TLV_UNICAST_ALGORITHM_LIST

Length: N * sizeof(WDI_ALGO_PAIRS)

Value: WDI_ALGO_PAIRS[N]

This usage is specified in the TLV reference topics with array notation.

Multi-TLV groups

When the size of a given object is not known ahead of time, multi-TLV groups are used. This usage pattern specifies that N different variably sized TLVs are expected within a given buffer. The number of entries (N) is not known ahead of time, and is inferred by the number of matching TLVs in the given buffer.

In this example, the parent buffer is a WDI_MESSAGE_HEADER, which defines the end of the TLV buffer. Note that WDI_TLV_BSS_ENTRY may be interspersed between other different TLV types in the parent buffer.

Offset Field Type
0 WDI_MESSAGE_HEADER Message header
sizeof(WDI_MESSAGE_HEADER) TLV₀ (WDI_TLV_BSS_ENTRY) WDI_BSS_ENTRY
TLV₀ + L₀ + sizeof(TLV Header) TLV₁ (WDI_TLV_BSS_ENTRY) WDI_BSS_ENTRY
TLV₁ + L₁ + sizeof(TLV Header) TLV₂ (WDI_TLV_BSS_ENTRY) WDI_BSS_ENTRY
TLV₂ + L₂ + sizeof(TLV Header) TLV₃ (OTHER_TLV_TYPE) Some other TLV type
TLV₃ + L₃ + sizeof(TLV Header) TLV₄ (WDI_TLV_BSS_ENTRY) WDI_BSS_ENTRY

For TLVs that contain other TLVs, the TLV reference topics have a Multiple TLV instances allowed column. If this column is checked, the specified TLV is allowed to appear multiple times. For an example of this, see WDI_TLV_CONNECT_PARAMETERS.