# `VintageNetWiFi.Event`
[🔗](https://github.com/nerves-networking/vintage_net_wifi/blob/v0.12.5/lib/vintage_net_wifi/event.ex#L1)

WiFi events.

Currently supported:
* `CTRL-EVENT-ASSOC-REJECT` - occurs when authentication fails
* `CTRL-EVENT-SSID-TEMP-DISABLED` - association with SSID is temporarily blocked by `wpa_supplicant` in some cases.
* `CTRL-EVENT-SSID-REENABLED` - matching event when SSID is re-enabled.

All events have a `:name`, and the other fields are optional.
* `CTRL-EVENT-ASSOC-REJECT`
  * `:bssid` - a unique address for the access point
  * `:status_code` - status code of the event
* `CTRL-EVENT-SSID-TEMP-DISABLED`
  * `:id` - event identifier?
  * `:ssid` - the access point's name
  * `:auth_failures` - how many failures occured to lead to disabling
  * `:duration` - time of block in seconds
  * `:reason` - why the SSID is disabled
* `CTRL-EVENT-SSID-REENABLED`
  * `:id` - event identifier?
  * `:ssid` - the access point's name

## Examples:

    iex> VintageNetWiFi.Event.new("CTRL-EVENT-ASSOC-REJECT", %{"bssid" => "ab:cd:ef:01:02:03", "status_code" => "1"})
    %VintageNetWiFi.Event{
      name: "CTRL-EVENT-ASSOC-REJECT",
      bssid: "ab:cd:ef:01:02:03",
      status_code: 1
    }

# `t`

```elixir
@type t() :: %VintageNetWiFi.Event{
  auth_failures: nil | non_neg_integer(),
  bssid: nil | String.t(),
  duration: nil | non_neg_integer(),
  id: nil | non_neg_integer(),
  name: nil | String.t(),
  reason: nil | String.t(),
  ssid: String.t(),
  status_code: nil | non_neg_integer()
}
```

WiFi event structure.

# `new`

```elixir
@spec new(String.t(), %{optional(String.t()) =&gt; String.t() | non_neg_integer()}) ::
  t()
```

Create an event with the appropriate fields

---

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