SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
sensesp::Networking Class Reference

Manages the ESP's connection to the Wifi network. More...

#include <sensesp/net/networking.h>

Inheritance diagram for sensesp::Networking:
[legend]

Public Member Functions

 Networking (const String &config_path, const String &client_ssid="", const String &client_password="", const String &ap_ssid="", const String &ap_password="")
 
 ~Networking ()
 
virtual void reset () override
 
virtual bool to_json (JsonObject &doc) override
 Serialize the current configuration to a JSON document.
 
virtual bool from_json (const JsonObject &config) override
 
void start_wifi_scan ()
 
int16_t get_wifi_scan_results (std::vector< WiFiNetworkInfo > &ssid_list)
 
bool is_captive_portal_enabled ()
 
const std::shared_ptr< WiFiStateProducer > & get_wifi_state_producer ()
 
- 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::Serializable
- 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::ValueProducer< WiFiState >
 ValueProducer ()
 
 ValueProducer (const WiFiState &initial_value)
 
virtual const WiFiStateget () 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)
 
- Public Member Functions inherited from sensesp::Observable
 Observable ()
 
 Observable (Observable &&other)
 Move constructor.
 
void notify ()
 
void attach (std::function< void()> observer)
 

Protected Member Functions

void start_access_point ()
 Start an access point.
 
void start_client_autoconnect ()
 Start WiFi using preset SSID and password.
 

Protected Attributes

AccessPointSettings ap_settings_
 
bool client_enabled_ = false
 
std::vector< ClientSSIDConfigclient_settings_
 
std::unique_ptr< DNSServer > dns_server_
 
std::shared_ptr< WiFiStateProducerwifi_state_producer_
 
std::shared_ptr< LambdaConsumer< WiFiState > > wifi_state_emitter_
 
- 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 ()
 

Detailed Description

Manages the ESP's connection to the Wifi network.

Definition at line 244 of file networking.h.

Constructor & Destructor Documentation

◆ Networking()

sensesp::Networking::Networking ( const String & config_path,
const String & client_ssid = "",
const String & client_password = "",
const String & ap_ssid = "",
const String & ap_password = "" )

Definition at line 28 of file networking.cpp.

Here is the call graph for this function:

◆ ~Networking()

sensesp::Networking::~Networking ( )

Definition at line 111 of file networking.cpp.

Member Function Documentation

◆ from_json()

bool sensesp::Networking::from_json ( const JsonObject & root)
overridevirtual

Deserializes the current object data from a JsonObject.

Reimplemented from sensesp::Serializable.

Definition at line 241 of file networking.cpp.

Here is the call graph for this function:

◆ get_wifi_scan_results()

int16_t sensesp::Networking::get_wifi_scan_results ( std::vector< WiFiNetworkInfo > & ssid_list)

Definition at line 317 of file networking.cpp.

◆ get_wifi_state_producer()

const std::shared_ptr< WiFiStateProducer > & sensesp::Networking::get_wifi_state_producer ( )
inline

Definition at line 265 of file networking.h.

◆ is_captive_portal_enabled()

bool sensesp::Networking::is_captive_portal_enabled ( )
inline

Definition at line 261 of file networking.h.

◆ reset()

void sensesp::Networking::reset ( )
overridevirtual

Reimplemented from sensesp::Resettable.

Definition at line 293 of file networking.cpp.

Here is the call graph for this function:

◆ start_access_point()

void sensesp::Networking::start_access_point ( )
protected

Start an access point.

Definition at line 124 of file networking.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start_client_autoconnect()

void sensesp::Networking::start_client_autoconnect ( )
protected

Start WiFi using preset SSID and password.

Definition at line 144 of file networking.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start_wifi_scan()

void sensesp::Networking::start_wifi_scan ( )

Definition at line 303 of file networking.cpp.

◆ to_json()

bool sensesp::Networking::to_json ( JsonObject & doc)
overridevirtual

Serialize the current configuration to a JSON document.

Reimplemented from sensesp::Serializable.

Definition at line 223 of file networking.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ ap_settings_

AccessPointSettings sensesp::Networking::ap_settings_
protected

Definition at line 273 of file networking.h.

◆ client_enabled_

bool sensesp::Networking::client_enabled_ = false
protected

Definition at line 275 of file networking.h.

◆ client_settings_

std::vector<ClientSSIDConfig> sensesp::Networking::client_settings_
protected

Definition at line 276 of file networking.h.

◆ dns_server_

std::unique_ptr<DNSServer> sensesp::Networking::dns_server_
protected

Definition at line 278 of file networking.h.

◆ wifi_state_emitter_

std::shared_ptr<LambdaConsumer<WiFiState> > sensesp::Networking::wifi_state_emitter_
protected

Definition at line 283 of file networking.h.

◆ wifi_state_producer_

std::shared_ptr<WiFiStateProducer> sensesp::Networking::wifi_state_producer_
protected
Initial value:
=
std::make_shared<WiFiStateProducer>()

Definition at line 280 of file networking.h.


The documentation for this class was generated from the following files: