|
SensESP 3.3.0
Universal Signal K sensor toolkit ESP32
|
Manages the ESP's WiFi connection. More...
#include <sensesp/net/wifi_provisioner.h>
Public Member Functions | |
| WiFiProvisioner (const String &config_path, const String &client_ssid="", const String &client_password="", const String &ap_ssid="", const String &ap_password="") | |
| ~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) |
| Public Member Functions inherited from sensesp::FileSystemSaveable | |
| 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) |
| Public Member Functions inherited from sensesp::Saveable | |
| 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 |
| Public Member Functions inherited from sensesp::Resettable | |
| Resettable (int priority=0) | |
| const int | get_reset_priority () const |
| void | set_reset_priority (int priority) |
| Public Member Functions inherited from sensesp::NetworkProvisioner | |
| virtual | ~NetworkProvisioner ()=default |
| Public Member Functions inherited from sensesp::ValueProducer< WiFiState > | |
| ValueProducer () | |
| 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. | |
| void | emit (const WiFiState &new_value) |
| Public Member Functions inherited from sensesp::Observable | |
| 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. | |
Protected Member Functions | |
| void | start_access_point () |
| void | start_client_autoconnect () |
Protected Attributes | |
| AccessPointSettings | ap_settings_ |
| bool | client_enabled_ = false |
| std::vector< ClientSSIDConfig > | client_settings_ |
| std::unique_ptr< DNSServer > | dns_server_ |
| Protected Attributes inherited from sensesp::Saveable | |
| const String | config_path_ |
| Protected Attributes inherited from sensesp::ValueProducer< WiFiState > | |
| WiFiState | output_ |
Additional Inherited Members | |
| Static Public Member Functions inherited from sensesp::Resettable | |
| static void | reset_all () |
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 String & | client_ssid = "", | ||
| const String & | client_password = "", | ||
| const String & | ap_ssid = "", | ||
| const String & | ap_password = "" ) |
|
override |
Definition at line 105 of file wifi_provisioner.cpp.
|
overridevirtual |
Deserializes the current object data from a JsonObject.
Reimplemented from sensesp::Serializable.
Definition at line 229 of file wifi_provisioner.cpp.
|
inlineoverridevirtual |
Default gateway IPv4 address. Returns IPAddress() if no link.
Implements sensesp::NetworkProvisioner.
Definition at line 190 of file wifi_provisioner.h.
| int16_t sensesp::WiFiProvisioner::get_wifi_scan_results | ( | std::vector< WiFiNetworkInfo > & | ssid_list | ) |
Definition at line 304 of file wifi_provisioner.cpp.
|
inline |
Definition at line 203 of file wifi_provisioner.h.
|
inline |
Definition at line 207 of file wifi_provisioner.h.
|
inlineoverridevirtual |
True iff the network interface is usable.
For STA/Ethernet this means link up + IP obtained. For WiFi in AP mode this also returns true — the device is network-reachable via the soft-AP even though it has no upstream connection. The Signal K websocket client uses this to gate connection attempts; the HTTP server uses it to know when the captive portal should be active.
Implements sensesp::NetworkProvisioner.
Definition at line 192 of file wifi_provisioner.h.
|
inlineoverridevirtual |
Current local IPv4 address. Returns IPAddress() if no link.
Implements sensesp::NetworkProvisioner.
Definition at line 189 of file wifi_provisioner.h.
|
inlineoverridevirtual |
Hardware MAC address of the active interface.
Format: "AA:BB:CC:DD:EE:FF". For multi-interface chips this returns the MAC of the interface SensESPApp is using to reach the network (e.g. the WiFi STA MAC, or the EMAC MAC).
Implements sensesp::NetworkProvisioner.
Definition at line 191 of file wifi_provisioner.h.
|
overridevirtual |
Reimplemented from sensesp::Resettable.
Definition at line 280 of file wifi_provisioner.cpp.
|
inline |
Definition at line 211 of file wifi_provisioner.h.
|
inline |
Definition at line 206 of file wifi_provisioner.h.
|
inline |
|
protected |
Definition at line 114 of file wifi_provisioner.cpp.
|
protected |
Definition at line 131 of file wifi_provisioner.cpp.
| void sensesp::WiFiProvisioner::start_wifi_scan | ( | ) |
Definition at line 290 of file wifi_provisioner.cpp.
|
overridevirtual |
Serializes the current object data into a JsonObject.
Reimplemented from sensesp::Serializable.
Definition at line 211 of file wifi_provisioner.cpp.
|
protected |
Definition at line 220 of file wifi_provisioner.h.
|
protected |
Definition at line 222 of file wifi_provisioner.h.
|
protected |
Definition at line 223 of file wifi_provisioner.h.
|
protected |
Definition at line 225 of file wifi_provisioner.h.