vintage_net_wizard v0.3.0 VintageNetWizard.BackendServer View Source

Server for managing a VintageNet.Backend implementation

Link to this section Summary

Functions

List out access points

Apply the configurations saved in the backend to the system.

Returns a specification to start this module under a supervisor.

Get the current state of the WiFi configuration

Get the current configuration status

Get a list of the current configurations

Delete the configuration by ssid

Return information about the device for the web page's footer

Reset the backend to an initial default state.

Save a WiFiConfiguration to the backend

Pass list of SSIDs (priority_order), sort the configurations to match that order.

Start scanning for WiFi access points

Stop scanning for WiFi access points

Subscribe to messages from the backend

Link to this section Functions

Specs

access_points() :: [VintageNetWiFi.AccessPoint.t()]

List out access points

Specs

apply() :: :ok | {:error, :no_configurations}

Apply the configurations saved in the backend to the system.

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

complete() :: :ok

Specs

configuration_state() :: %VintageNetWizard.BackendServer.State{
  backend: term(),
  backend_state: term(),
  configurations: term(),
  subscriber: term()
}

Get the current state of the WiFi configuration

Get the current configuration status

Specs

configurations() :: [VintageNetWizard.WiFiConfiguration.t()]

Get a list of the current configurations

Link to this function

delete_configuration(ssid)

View Source

Specs

delete_configuration(String.t()) :: :ok

Delete the configuration by ssid

Specs

device_info() :: [{String.t(), String.t()}]

Return information about the device for the web page's footer

Specs

reset() :: :ok

Reset the backend to an initial default state.

Specs

save(VintageNetWizard.WiFiConfiguration.t()) :: :ok | {:error, any()}

Save a WiFiConfiguration to the backend

Link to this function

set_priority_order(priority_order)

View Source

Specs

set_priority_order([String.t()]) :: :ok

Pass list of SSIDs (priority_order), sort the configurations to match that order.

Specs

start_link(backend :: module()) :: GenServer.on_start()

Specs

start_scan() :: :ok

Start scanning for WiFi access points

Specs

stop_scan() :: :ok

Stop scanning for WiFi access points

Specs

subscribe() :: :ok

Subscribe to messages from the backend