nerves-networking / vintage_net_wifi

WiFi networking for VintageNet
Apache License 2.0
32 stars 18 forks source link

Add quick configure and cookbook helper functions #32

Closed fhunleth closed 3 years ago

fhunleth commented 3 years ago

The goal for these helpers is to lower the friction to configuring the most common types of networks. There are two interfaces:

  1. VintageNetWiFi.quick_configure for configuring WiFi on "wlan0" to either an open WiFi configuration or a WPA-PSK2 one
  2. VintageNetWiFi.Cookbook for a set of helper functions for coming up with the configurations to pass to VintageNet.configure/2

My hope is that users will do this at the iex prompt:

iex> VintageNetWiFi.quick_configure("my_access_point_name", "password")

and then wait a bit and then their device will be connected. The quick_configure functions only work for WPA2 PSK and open networks, but that's probably 90+% of what people have.

The next step is to help make the configurations. That's what VintageNetWiFi.Cookbook is for and these configurations could be used anywhere. For example, these functions could help make hardcoded configs in the config.exs or they could be used in people's programs to avoid dealing with the configuration maps.

The quick_configure functions use the VintageNetWiFi.Cookbook.