VintageNetWizard.BackendServer (vintage_net_wizard v0.4.3) 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 network configuration 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.

Link to this function

child_spec(backend, ifname, opts \\ [])

View Source

Specs

complete() :: :ok

Specs

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

Get the current state of the WiFi configuration

Get the current configuration status

Specs

configurations() :: [map()]

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(map()) :: :ok | {:error, any()}

Save a network configuration to the backend

The network configuration is a map that can be included in the :network field of a VintageNetWiFi configuration.

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.

Link to this function

start_link(backend, ifname, opts \\ [])

View Source

Specs

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