# `QMI.Codec.WirelessData`
[🔗](https://github.com/nerves-networking/qmi/blob/v0.10.3/lib/qmi/codec/wireless_data.ex#L7)

Codec for making wireless data service requests

# `call_end_reason_type`

```elixir
@type call_end_reason_type() ::
  :unspecified
  | :mobile_ip
  | :internal
  | :call_manger_defined
  | :three_gpp_specification_defined
  | :ppp
  | :ehrpd
  | :ipv6
  | :handoff
```

The type of reasons the call ended

# `current_settings`

```elixir
@type current_settings() :: %{
  optional(:ipv4_mtu) =&gt; non_neg_integer(),
  optional(:ipv6_mtu) =&gt; non_neg_integer()
}
```

Subset of current settings we care about for MTU management

# `event_report_indication`

```elixir
@type event_report_indication() :: %{
  :name =&gt; :event_report_indication,
  optional(:tx_bytes) =&gt; integer(),
  optional(:rx_bytes) =&gt; integer(),
  optional(:tx_packets) =&gt; integer(),
  optional(:rx_packets) =&gt; integer(),
  optional(:tx_overflows) =&gt; integer(),
  optional(:rx_overflows) =&gt; integer(),
  optional(:tx_errors) =&gt; integer(),
  optional(:rx_errors) =&gt; integer(),
  optional(:tx_drops) =&gt; integer(),
  optional(:rx_drops) =&gt; integer()
}
```

The indication for the wireless data service's event report

To configure what information is sent through this indication see
`set_event_report/1`.

# `event_report_opt`

```elixir
@type event_report_opt() ::
  {:statistics_interval, non_neg_integer()}
  | {:statistics, [statistic_measurement()] | :all | :none}
```

Options for the wireless data event report configuration

* `:statistics_interval` - an interval in seconds on when to report statistics
  about transmit and receive operations
* `:statistics` - list which statistic measurements to report

For transmit and receive statistics, if no interval is provided the default is
60 seconds. If the `:statistics` option is not provided it will default to
`:all`. The report is only sent in the interval if there was a change in any
of the statistics. So, if no changes took place the report will be skipped for
an interval.

To configure event report to not included any stats pass `:none` to
the `:statistics` option.

# `get_current_settings_opt`

```elixir
@type get_current_settings_opt() ::
  {:extended_mask, non_neg_integer()} | {:packet_data_handle, non_neg_integer()}
```

Options for Get Current Settings

* `:extended_mask` - 32-bit mask for Extended Requested Settings TLV (0x11). Defaults to 0xFFFFFFFF.
* `:packet_data_handle` - integer PDH from Start Network Interface response (TLV 0x01).

# `ip_family`

```elixir
@type ip_family() :: 4 | 6
```

IP family selector for WDS Get Current Settings

* `4` - IPv4
* `6` - IPv6

# `modify_profile_settings_response`

```elixir
@type modify_profile_settings_response() :: %{extended_error_code: integer() | nil}
```

Response from issuing a modify profile settings request

# `packet_status_indication`

```elixir
@type packet_status_indication() :: %{
  name: :packet_status_indication,
  status: :disconnected | :connected | :suspended | :authenticating,
  reconfiguration_required: boolean(),
  call_end_reason: integer() | nil,
  call_end_reason_type: call_end_reason_type() | nil,
  ip_family: 4 | 6 | nil,
  tech_name: tech_name() | nil,
  bearer_id: integer() | nil,
  xlat_capable: boolean() | nil
}
```

The indication for a change in the current packet data connection status

# `profile_setting`

```elixir
@type profile_setting() ::
  {:roaming_disallowed, boolean()} | {:profile_type, profile_type()}
```

The profile settings

* `:roaming_disallowed` - if using roaming is allowed or not
* `:profile_type` - the profile type - see `profile_type()` type docs for more
  information

# `profile_type`

```elixir
@type profile_type() :: :profile_type_3gpp | :profile_type_3gpp2 | :profile_type_epc
```

The profile technology type

# `start_network_interface_opt`

```elixir
@type start_network_interface_opt() ::
  {:apn, String.t()} | {:profile_3gpp_index, integer()}
```

Options for whens starting a network interface

* `:apn` - the name of our APN

# `start_network_report`

```elixir
@type start_network_report() :: %{packet_data_handle: non_neg_integer()}
```

Report from starting the network interface

# `statistic_measurement`

```elixir
@type statistic_measurement() ::
  :tx_bytes
  | :rx_bytes
  | :tx_packets
  | :rx_packets
  | :tx_overflows
  | :rx_overflows
  | :tx_errors
  | :rx_errors
  | :tx_drops
  | :rx_drops
```

The type of measurement you are wanting to be reported

* `:tx_bytes` - number of bytes transmitted
* `:rx_bytes` - number of bytes received
* `:tx_packets` - number of transmit packets sent without error
* `:rx_packets` - number of packets received without error
* `:tx_overflows` - number of packets dropped due to tx buffer
  overflowed (out of memory)
* `:rx_overflows` - number of packets dropped due to rx buffer
  overflowed (out of memory)
* `:tx_errors` - number of outgoing packets with framing errors
* `:rx_errors` - number of incoming packets with framing errors
* `:tx_drops` - number outgoing packets dropped
* `:rx_drops` - number incoming packets dropped

# `tech_name`

```elixir
@type tech_name() ::
  :cdma
  | :umts
  | :wlan_local_brkout
  | :iwlan_s2b
  | :epc
  | :embms
  | :modem_link_local
```

Name of the technology

# `get_current_settings`

```elixir
@spec get_current_settings(ip_family()) :: QMI.request()
```

Build WDS Get Current Settings request. Defaults to IPv4 if no family given.

The request includes:
- TLV 0x10 (Requested Settings mask) set to all bits (0xFFFFFFFF) to get all available fields
- TLV 0x19 (IP family) as 0x04 for IPv4 or 0x06 for IPv6

# `get_current_settings`

```elixir
@spec get_current_settings(ip_family(), [get_current_settings_opt()]) :: QMI.request()
```

Build WDS Get Current Settings request with options similar a qmicli.

Supported options:
* `:extended_mask` - adds TLV 0x11 (Extended Requested Settings) with this mask
* `:packet_data_handle` - adds TLV 0x01 (Packet Data Handle) with given PDH

# `modify_profile_settings`

```elixir
@spec modify_profile_settings(profile_index :: integer(), [profile_setting()]) ::
  QMI.request()
```

Modify the QMI profile setting

When providing the profile settings if `:profile_type` is not included this
function will default to `:profile_type_3gpp`

# `parse_event_report_indication`

```elixir
@spec parse_event_report_indication(event_report_indication(), binary()) ::
  event_report_indication()
```

# `parse_indication`

```elixir
@spec parse_indication(binary()) ::
  {:ok, packet_status_indication() | event_report_indication()}
  | {:error, :invalid_indication}
```

Try to parse an indication from the wireless data service

# `set_event_report`

```elixir
@spec set_event_report([event_report_opt()]) :: QMI.request()
```

Request to set the wireless data services event report options

# `start_network_interface`

```elixir
@spec start_network_interface([start_network_interface_opt()]) :: QMI.request()
```

Send command to request the that the network interface starts to receive data

# `stat_to_integer`

```elixir
@spec stat_to_integer(statistic_measurement()) ::
  1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512
```

# `statistics_mask`

```elixir
@spec statistics_mask(:all | [statistic_measurement()]) :: non_neg_integer()
```

---

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