View Source VintageNetWizard.BackendServer (vintage_net_wizard v0.4.16)

Server for managing a VintageNet.Backend implementation

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

Functions

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

List out access points

@spec 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
@spec child_spec(any(), any(), keyword()) :: map()
@spec complete() :: :ok
@spec configuration_state() :: map()

Get the current state of the WiFi configuration

@spec configuration_status() :: any()

Get the current configuration status

@spec configurations() :: [map()]

Get a list of the current configurations

Link to this function

delete_configuration(ssid)

View Source
@spec delete_configuration(String.t()) :: :ok

Delete the configuration by ssid

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

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

@spec reset() :: :ok

Reset the backend to an initial default state.

@spec 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
@spec 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
@spec start_link(backend :: module(), VintageNet.ifname(), [
  VintageNetWizard.Backend.opt()
]) ::
  GenServer.on_start()
@spec start_scan() :: :ok

Start scanning for WiFi access points

@spec stop_scan() :: :ok

Stop scanning for WiFi access points

@spec subscribe() :: :ok

Subscribe to messages from the backend