|
TinyWifiDongle 0.1.0
Header-only USB WiFi dongle for Arduino
|
Finds out which WiFi network to join: from flash, or from the user through a setup page. More...
#include <TinyWifiDongleSetup.h>
Public Member Functions | |
| TinyWifiDongleSetup (const char *setupNetwork="TinyWifiDongle-Setup", const char *setupPassword=nullptr) | |
| The setup network is called setupNetwork; setupPassword (at least 8 characters) protects it, nullptr leaves it open. | |
| void | setForgetWindow (uint32_t ms) |
| How long, after a start, the BOOT button (ESP32) or BOOTSEL button (Pico) forgets the saved network; 0 switches the button off. Default 3000. | |
| void | setJoinTimeout (uint32_t ms) |
| How long a start may take to join the network before the saved network is forgotten and the setup opens again; 0 = never. Default 60000. | |
| void | begin () |
| Loads the saved network, or opens the setup and blocks until the user has entered one. | |
| const char * | ssid () const |
| Name of the network to join; valid after begin(). | |
| const char * | password () const |
| Password of the network to join, nullptr for an open network; valid after begin(). | |
| void | forget () |
| Removes the saved network; the next start opens the setup. | |
| void | update (bool connected) |
| Call regularly with TinyWifiDongle::isWifiConnected(). If the board has not joined the network within the join timeout of a start, the saved network is forgotten and the board restarts, so that the setup opens again. | |
Finds out which WiFi network to join: from flash, or from the user through a setup page.
begin() uses the network saved in flash. If there is none, the board opens its own WiFi network (the "setup network"); a phone or laptop that joins it is led to a page on which the user picks a network and enters the password. The choice is saved in flash, so the next start needs no setup.
The setup page needs the board to have an IP address, which the bridge of TinyWifiDongle never has. So the setup runs first and the dongle takes over the WiFi chip afterwards; the USB adapter does not exist while the setup runs.
Definition at line 41 of file TinyWifiDongleSetup.h.
|
inlineexplicit |
The setup network is called setupNetwork; setupPassword (at least 8 characters) protects it, nullptr leaves it open.
Definition at line 44 of file TinyWifiDongleSetup.h.
|
inline |
Loads the saved network, or opens the setup and blocks until the user has entered one.
Definition at line 54 of file TinyWifiDongleSetup.h.
|
inline |
Removes the saved network; the next start opens the setup.
Definition at line 78 of file TinyWifiDongleSetup.h.
|
inline |
Password of the network to join, nullptr for an open network; valid after begin().
Definition at line 75 of file TinyWifiDongleSetup.h.
|
inline |
How long, after a start, the BOOT button (ESP32) or BOOTSEL button (Pico) forgets the saved network; 0 switches the button off. Default 3000.
Definition at line 48 of file TinyWifiDongleSetup.h.
|
inline |
How long a start may take to join the network before the saved network is forgotten and the setup opens again; 0 = never. Default 60000.
Definition at line 51 of file TinyWifiDongleSetup.h.
|
inline |
Name of the network to join; valid after begin().
Definition at line 72 of file TinyWifiDongleSetup.h.
|
inline |
Call regularly with TinyWifiDongle::isWifiConnected(). If the board has not joined the network within the join timeout of a start, the saved network is forgotten and the board restarts, so that the setup opens again.
Definition at line 81 of file TinyWifiDongleSetup.h.