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

Control a wpa_supplicant instance for an interface.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `raw_command`

```elixir
@spec raw_command(VintageNet.ifname(), String.t()) ::
  {:ok, String.t()} | {:error, any()}
```

Send a raw command to the `wpa_supplicant`

This doesn't do any kind of processing on the results and just returns whatever
`wpa_supplicant` says. See [ctrl_iface](https://w1.fi/wpa_supplicant/devel/ctrl_iface_page.html)
and `ctrl_iface.c` for options.

    iex> VintageNetWiFi.WPASupplicant.raw_command("wlan0", "GET_CAPABILITY modes")
    {:ok, "AP MESH"}

# `scan`

```elixir
@spec scan(VintageNet.ifname()) :: :ok
```

Initiate a scan of WiFi networks

# `signal_poll`

```elixir
@spec signal_poll(VintageNet.ifname()) :: {:ok, any()} | {:error, any()}
```

Polls for signal level info

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

Start a GenServer to manage communication with a wpa_supplicant

Arguments:

* `:wpa_supplicant - the path to the wpa_supplicant binary
* `:wpa_supplicant_conf_path - the path to the supplicant's conf file
* `:ifname` - the network interface
* `:control_path` - the path to the wpa_supplicant control file
* `:keep_alive_interval` - how often to ping the wpa_supplicant to
  make sure it's still alive (defaults to 60,000 seconds)
* `:ap_mode` - true if the WiFi module and wpa_supplicant are
  in access point mode

# `wps_pbc`

```elixir
@spec wps_pbc(VintageNet.ifname()) :: {:ok, any()} | {:error, any()}
```

Enable reception of WiFi credentials via WPS

---

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