|
| | WiFiProvisioner (const String &config_path, const String &client_ssid="", const String &client_password="", const String &ap_ssid="", const String &ap_password="") |
| |
| | WiFiProvisioner (const String &config_path, const std::vector< ClientSSIDConfig > &client_configs, const String &ap_ssid="", const String &ap_password="") |
| | Construct with a preset list of client (STA) networks.
|
| |
| | ~WiFiProvisioner () override |
| |
| void | reset () override |
| |
| bool | to_json (JsonObject &doc) override |
| |
| bool | from_json (const JsonObject &config) override |
| |
| IPAddress | local_ip () const override |
| | Current local IPv4 address. Returns IPAddress() if no link.
|
| |
| IPAddress | gateway_ip () const override |
| | Default gateway IPv4 address. Returns IPAddress() if no link.
|
| |
| String | mac_address () const override |
| | Hardware MAC address of the active interface.
|
| |
| bool | is_connected () const override |
| | True iff the network interface is usable.
|
| |
| ValueProducer< WiFiState > * | get_wifi_state_producer () |
| |
| IPAddress | soft_ap_ip () const |
| |
| bool | is_captive_portal_enabled () const |
| |
| String | ssid () const |
| |
| int | rssi () const |
| |
| void | start_wifi_scan () |
| |
| int16_t | get_wifi_scan_results (std::vector< WiFiNetworkInfo > &ssid_list) |
| |
| | FileSystemSaveable (const String &config_path) |
| |
| virtual bool | load () override |
| | Load and populate the object from a persistent storage.
|
| |
| virtual bool | save () override |
| | Save the object to a persistent storage.
|
| |
| virtual bool | clear () override |
| | Delete the data from a persistent storage.
|
| |
| bool | find_config_file (const String &config_path, String &filename) |
| |
| | Saveable (const String &config_path) |
| |
| virtual bool | refresh () |
| | Refresh the object. This may or may not access the persistent storage but is not expected to overwrite the object's state.
|
| |
| const String & | get_config_path () const |
| |
| | Resettable (int priority=0) |
| |
| const int | get_reset_priority () const |
| |
| void | set_reset_priority (int priority) |
| |
| virtual | ~NetworkProvisioner ()=default |
| |
| | ValueProducer () |
| |
| | ValueProducer (const WiFiState &initial_value) |
| |
| virtual const WiFiState & | get () const |
| |
| std::enable_if< std::is_base_of< ValueConsumer< typenameVConsumer::input_type >, VConsumer >::value &&std::is_convertible< WiFiState, typenameVConsumer::input_type >::value, std::shared_ptr< VConsumer > >::type | connect_to (std::shared_ptr< VConsumer > consumer) |
| | Connect a producer to a transform with a different input type.
|
| |
| std::enable_if< std::is_base_of< ValueConsumer< typenameVConsumer::input_type >, VConsumer >::value &&std::is_convertible< WiFiState, typenameVConsumer::input_type >::value, VConsumer * >::type | connect_to (VConsumer *consumer) |
| |
| std::enable_if< std::is_base_of< ValueConsumer< typenameVConsumer::input_type >, VConsumer >::value &&std::is_convertible< WiFiState, typenameVConsumer::input_type >::value, VConsumer * >::type | connect_to (VConsumer &consumer) |
| |
| void | emit (const WiFiState &new_value) |
| |
| | Observable () |
| |
| | Observable (Observable &&other) |
| | Move constructor.
|
| |
| void | notify () |
| |
| int | attach (std::function< void()> observer) |
| | Attach an observer callback.
|
| |
| void | detach (int id) |
| | Remove a previously attached observer by its ID.
|
| |
Manages the ESP's WiFi connection.
Inherits from NetworkProvisioner so SensESPApp can hold any provisioner implementation through the same shared_ptr type. Adds WiFi-specific methods (scanning, soft-AP IP, captive portal flag) directly on the concrete class — code that needs them holds a typed pointer via SensESPApp::get_wifi_provisioner().
The legacy Networking class name is preserved as a typedef in networking.h for source-level backward compatibility.
Definition at line 170 of file wifi_provisioner.h.
| sensesp::WiFiProvisioner::WiFiProvisioner |
( |
const String & |
config_path, |
|
|
const std::vector< ClientSSIDConfig > & |
client_configs, |
|
|
const String & |
ap_ssid = "", |
|
|
const String & |
ap_password = "" |
|
) |
| |
Construct with a preset list of client (STA) networks.
Seeds up to kMaxNumClientConfigs client configurations that are tried in order, failing over between them, when the device is not already associated. Use this instead of the single-SSID constructor to define more than one network in code (the same list the web UI edits).
Like the single-SSID constructor, the presets are applied only when no configuration has been saved to flash yet; a saved (e.g. web-UI-edited) list always wins and is never overwritten. Client entries with an empty SSID or password are ignored. Any entries beyond kMaxNumClientConfigs are dropped.
- Parameters
-
| config_path | flash config path (identifies the saved object) |
| client_configs | ordered list of client networks to try |
| ap_ssid | soft-AP SSID, or "" to leave the AP disabled |
| ap_password | soft-AP password |
Definition at line 54 of file wifi_provisioner.cpp.
| void sensesp::WiFiProvisioner::init_wifi |
( |
| ) |
|
|
protected |
Bring the WiFi interface up from the current ap_settings_ / client_settings_ state. Shared by both constructors: it pads the client list to kMaxNumClientConfigs, selects the STA/AP/AP+STA mode, and starts the access point, client autoconnect, and captive-portal DNS as needed.
Definition at line 89 of file wifi_provisioner.cpp.