# `QMI.Codec.WirelessDataAdmin`
[🔗](https://github.com/nerves-networking/qmi/blob/v0.10.4/lib/qmi/codec/wireless_data_admin.ex#L6)

Codec for the QMI WDA (Wireless Data Administrative) service.

The WDA service configures the data format used between the modem and the
host driver.  On modems whose `qmi_wwan` driver does not expose
`/sys/class/net/<ifname>/qmi/raw_ip`, this is the only way to switch the
data path between 802.3 (Ethernet) framing and raw-IP framing.

# `aggregation_protocol`

```elixir
@type aggregation_protocol() :: :disabled | :qmap_v1 | :qmap_v5 | :unknown
```

Data aggregation protocol.

* `:disabled` – no aggregation
* `:qmap_v1` – QMAP version 1
* `:qmap_v5` – QMAP version 5

# `data_format`

```elixir
@type data_format() :: %{
  optional(:qos_format) =&gt; boolean(),
  optional(:link_layer_protocol) =&gt; link_layer_protocol(),
  optional(:ul_aggregation_protocol) =&gt; aggregation_protocol(),
  optional(:dl_aggregation_protocol) =&gt; aggregation_protocol(),
  optional(:dl_max_datagrams) =&gt; non_neg_integer(),
  optional(:dl_max_size) =&gt; non_neg_integer()
}
```

Result of `get_data_format/0` or `set_data_format/1`.

# `link_layer_protocol`

```elixir
@type link_layer_protocol() :: :raw_ip | :&quot;802.3&quot; | :unknown
```

Link-layer protocol for the data path.

* `:raw_ip` – raw IP packets (no Ethernet header)
* `:"802.3"` – Ethernet-framed packets

# `set_data_format_opt`

```elixir
@type set_data_format_opt() ::
  {:link_layer_protocol, link_layer_protocol()}
  | {:ul_aggregation_protocol, aggregation_protocol()}
  | {:dl_aggregation_protocol, aggregation_protocol()}
  | {:qos_format, boolean()}
  | {:endpoint_type, non_neg_integer()}
  | {:endpoint_iface_number, non_neg_integer()}
```

Options for `set_data_format/1`.

* `:link_layer_protocol` – `:raw_ip` or `:"802.3"` (required)
* `:ul_aggregation_protocol` – uplink aggregation (default `:disabled`)
* `:dl_aggregation_protocol` – downlink aggregation (default `:disabled`)
* `:qos_format` – whether to include QoS headers (default `false`)
* `:endpoint_type` – endpoint device type (default `2` for HSUSB)
* `:endpoint_iface_number` – interface number on the endpoint

# `get_data_format`

```elixir
@spec get_data_format() :: QMI.request()
```

Build a request to query the current data format.

# `set_data_format`

```elixir
@spec set_data_format([set_data_format_opt()]) :: QMI.request()
```

Build a request to set the data format.

## Examples

    QMI.Codec.WirelessDataAdmin.set_data_format(link_layer_protocol: :raw_ip)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
