# VintageNetWizard.Backend behaviour (vintage_net_wizard v0.4.2) View Source

Backends define the boundaries of getting access points, handling incoming messages, and scanning the network

# Link to this section Summary

## Types

configuration_status()
device_info_name()
device_info_value()
opt()

## Callbacks

access_points(state)

Get all the access points that the backend knowns about

apply(list, state)

Apply the WiFi configurations

complete(list, state)

Perform final completion steps for the network configurations

configuration_status(state)

Return the configuration status of a configuration that has been applied

handle_info(any, state)

Handle any message the is received by another process

init(arg1)

Do any initialization work like subscribing to messages

reset(state)

Apply any actions required to set the backend back to an initial default state

start_scan(state)

Start scanning for WiFi access points

stop_scan(state)

Stop the scan for WiFi access points

# Link to this section Types

Link to this type

# configuration_status()

View Source

## Specs

    configuration_status() :: :not_configured | :good | :bad

Link to this type

# device_info_name()

View Source

## Specs

    device_info_name() :: String.t()

Link to this type

# device_info_value()

View Source

## Specs

    device_info_value() :: String.t()

Link to this type

# opt()

View Source

## Specs

    opt() ::
      {:device_info, [{device_info_name(), device_info_value()}]}
      | {:configurations, [map()]}

# Link to this section Callbacks

Link to this callback

# access_points(state)

View Source

## Specs

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

Get all the access points that the backend knowns about

Link to this callback

# apply(list, state)

View Source

## Specs

    apply([map()], state :: any()) ::
      {:ok, state :: any()} | {:error, :invalid_state}

Apply the WiFi configurations

The configurations passed are network configurations that can be passed into the `:network` list in a `VintageNetWiFi` configuration.

Link to this callback

# complete(list, state)

View Source

## Specs

    complete([map()], state :: any()) :: {:ok, state :: any()}

Perform final completion steps for the network configurations

Link to this callback

# configuration_status(state)

View Source

## Specs

    configuration_status(state :: any()) :: configuration_status()

Return the configuration status of a configuration that has been applied

Link to this callback

# handle_info(any, state)

View Source

## Specs

    handle_info(any(), state :: any()) ::
      {:reply, any(), state :: any()} | {:noreply, state :: any()}

Handle any message the is received by another process

If you want the socket to send data to the client return `{:reply, message, state}`, otherwise return `{:noreply, state}`

Link to this callback

# init(arg1)

View Source

## Specs

    init(VintageNet.ifname()) :: state :: any()

Do any initialization work like subscribing to messages

Will be passed the interface name that the backend should use. By default this will be `"wlan0"`. If you want to use a different interface name you can pass that in an option to `VintageNetWizard.run_wizard/1`.

Link to this callback

# reset(state)

View Source

## Specs

    reset(state :: any()) :: state :: any()

Apply any actions required to set the backend back to an initial default state

Link to this callback

# start_scan(state)

View Source

## Specs

    start_scan(state :: any()) :: state :: any()

Start scanning for WiFi access points

Link to this callback

# stop_scan(state)

View Source

## Specs

    stop_scan(state :: any()) :: state :: any()

Stop the scan for WiFi access points