View Source VintageNetWiFi.WPASupplicant (vintage_net_wifi v0.12.5)

Control a wpa_supplicant instance for an interface.

Summary

Functions

Returns a specification to start this module under a supervisor.

Send a raw command to the wpa_supplicant

Initiate a scan of WiFi networks

Polls for signal level info

Start a GenServer to manage communication with a wpa_supplicant

Enable reception of WiFi credentials via WPS

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

raw_command(ifname, command)

View Source
@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 and ctrl_iface.c for options.

iex> VintageNetWiFi.WPASupplicant.raw_command("wlan0", "GET_CAPABILITY modes")
{:ok, "AP MESH"}
@spec scan(VintageNet.ifname()) :: :ok

Initiate a scan of WiFi networks

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

Polls for signal level info

@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
@spec wps_pbc(VintageNet.ifname()) :: {:ok, any()} | {:error, any()}

Enable reception of WiFi credentials via WPS