vintage_net_wizard v0.1.5 VintageNetWizard.WiFiConfiguration View Source

A WiFiConfiguration is used for clients to define the settings for a WiFi access point.

Link to this section Summary

Functions

Decode JSON string into WiFiConfiguration

Try to make a WiFiConfiguration from a map.

Make a new WiFiConfiguration struct

Take a WiFiConfiguration.t() and turn into a map that is used to configure VintageNet

Validate the password for the WiFiConfiguration

Link to this section Types

Link to this type

decode_error()

View Source
decode_error() ::
  {:error, :json_decode, Jason.DecodeError.t()}
  | {:error, param_error(), value :: any()}
Link to this type

key_mgmt()

View Source
key_mgmt() :: :none | :wpa_psk
Link to this type

opt()

View Source
opt() ::
  {:key_mgmt, atom()} | {:password, binary()} | {:priority, non_neg_integer()}
Link to this type

param_error()

View Source
param_error() :: :invalid_key_mgmt | :invalid_ssid
Link to this type

t()

View Source
t() :: %VintageNetWizard.WiFiConfiguration{
  key_mgmt: key_mgmt(),
  password: String.t() | nil,
  priority: non_neg_integer() | nil,
  ssid: String.t()
}

Link to this section Functions

Link to this function

decode(json)

View Source
decode(binary()) :: {:ok, t()} | decode_error()

Decode JSON string into WiFiConfiguration

Link to this function

from_map(params)

View Source
from_map(map()) ::
  {:ok, t()}
  | {:error, param_error(), value :: any()}
  | {:error, :password_required, key_mgmt()}
  | {:error, VintageNet.WiFi.WPA2.invalid_passphrase_error()}

Try to make a WiFiConfiguration from a map.

Required fields:

  • "ssid" - The SSID of the access point
  • "key_mgmt" - The key management to use

Options fields:

  • "password" - The password for the access point
Link to this function

new(ssid, opts)

View Source
new(binary(), [opt()]) :: t()

Make a new WiFiConfiguration struct

Link to this function

to_vintage_net_configuration(wi_fi_configuration)

View Source
to_vintage_net_configuration(t()) ::
  map()
  | {:error, VintageNet.WiFi.WPA2.invalid_passphrase_error()}
  | {:error, :password_required, key_mgmt()}

Take a WiFiConfiguration.t() and turn into a map that is used to configure VintageNet

Link to this function

validate_password(wi_fi_configuration)

View Source
validate_password(t()) ::
  :ok
  | {:error, VintageNet.WiFi.WPA2.invalid_passphrase_error()}
  | {:error, :password_required, key_mgmt()}

Validate the password for the WiFiConfiguration