SensESP 2.7.2
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 (String config_path, String ssid, String password, String hostname, const char *wifi_manager_password)
 
virtual void start () override
 
virtual void reset () override
 
virtual void get_configuration (JsonObject &doc) override final
 
virtual bool set_configuration (const JsonObject &config) override final
 
virtual String get_config_schema () override
 
void enable_wifi_manager (bool state)
 
void activate_wifi_manager ()
 
void set_wifi_manager_ap_ssid (String ssid)
 
void set_ap_mode (bool state)
 
- Public Member Functions inherited from sensesp::Configurable
 Configurable (String config_path="", String description="", int sort_order=1000)
 
String get_description ()
 
void set_description (String description)
 Set the description of the Configurable.
 
int get_sort_order ()
 
void set_sort_order (int sort_order)
 
virtual void save_configuration ()
 
- Public Member Functions inherited from sensesp::Startable
 Startable (int priority=0)
 
const int get_start_priority ()
 
void set_start_priority (int priority)
 
- 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 ()
 
virtual const WiFiStateget () const
 
void connect_to (ValueConsumer< WiFiState > *consumer, uint8_t input_channel=0)
 
void connect_to (ValueConsumer< CT > *consumer, uint8_t input_channel=0)
 Connect a producer to a consumer of a different type.
 
Transform< WiFiState, T2 > * connect_to (Transform< WiFiState, T2 > *consumer_producer, uint8_t input_channel=0)
 
Transform< TT, T2 > * connect_to (Transform< TT, T2 > *consumer_producer, uint8_t input_channel=0)
 Connect a producer to a transform with a different input type.
 
void emit (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 setup_saved_ssid ()
 Start WiFi using preset SSID and password.
 
void setup_wifi_manager ()
 Start WiFi using WiFi Manager.
 
void wifi_station_connected ()
 
void wifi_ap_enabled ()
 
void wifi_disconnected ()
 
- Protected Member Functions inherited from sensesp::Configurable
virtual void load_configuration ()
 

Additional Inherited Members

- Static Public Member Functions inherited from sensesp::Startable
static void start_all ()
 
- Static Public Member Functions inherited from sensesp::Resettable
static void reset_all ()
 
- Public Attributes inherited from sensesp::Configurable
const String config_path_
 
- Protected Attributes inherited from sensesp::Configurable
String description_ = ""
 
int sort_order_ = 1000
 
- Protected Attributes inherited from sensesp::ValueProducer< WiFiState >
WiFiState output
 

Detailed Description

Manages the ESP's connection to the Wifi network.

Definition at line 102 of file networking.h.

Constructor & Destructor Documentation

◆ Networking()

sensesp::Networking::Networking ( String  config_path,
String  ssid,
String  password,
String  hostname,
const char wifi_manager_password 
)

Definition at line 24 of file networking.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ activate_wifi_manager()

void sensesp::Networking::activate_wifi_manager ( )

Definition at line 81 of file networking.cpp.

Here is the call graph for this function:

◆ enable_wifi_manager()

void sensesp::Networking::enable_wifi_manager ( bool  state)
inline

Definition at line 116 of file networking.h.

◆ get_config_schema()

String sensesp::Networking::get_config_schema ( )
overridevirtual

Returns a configuration schema that specifies the key/value pairs that can be expected when calling get_configuration(), or are expected by set_configuration(). The schema will be in JSON Schema format

See also
https://json-schema.org

Reimplemented from sensesp::Configurable.

Definition at line 216 of file networking.cpp.

◆ get_configuration()

void sensesp::Networking::get_configuration ( JsonObject configObject)
finaloverridevirtual

Returns the current configuration data as a JsonObject. In general, the current state of local member variables are saved to a new object created with JsonDocument::as<JsonObject>() and returned.

Reimplemented from sensesp::Configurable.

Definition at line 232 of file networking.cpp.

Here is the call graph for this function:

◆ reset()

void sensesp::Networking::reset ( )
overridevirtual

Reimplemented from sensesp::Resettable.

Definition at line 267 of file networking.cpp.

Here is the call graph for this function:

◆ set_ap_mode()

void sensesp::Networking::set_ap_mode ( bool  state)
inline

Definition at line 122 of file networking.h.

◆ set_configuration()

bool sensesp::Networking::set_configuration ( const JsonObject config)
finaloverridevirtual

Sets the current state of local member variables using the data stored in config.

Reimplemented from sensesp::Configurable.

Definition at line 241 of file networking.cpp.

Here is the call graph for this function:

◆ set_wifi_manager_ap_ssid()

void sensesp::Networking::set_wifi_manager_ap_ssid ( String  ssid)
inline

Definition at line 120 of file networking.h.

◆ setup_saved_ssid()

void sensesp::Networking::setup_saved_ssid ( )
protected

Start WiFi using preset SSID and password.

Definition at line 91 of file networking.cpp.

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

◆ setup_wifi_manager()

void sensesp::Networking::setup_wifi_manager ( )
protected

Start WiFi using WiFi Manager.

If the setup process has been completed before, this method will start the WiFi connection using the saved SSID and password. Otherwise, it will start the WiFi Manager.

Definition at line 125 of file networking.cpp.

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

◆ start()

void sensesp::Networking::start ( )
overridevirtual

Called during the initialization process. Override this method to add runtime initialization code to your class

Reimplemented from sensesp::Startable.

Definition at line 63 of file networking.cpp.

Here is the call graph for this function:

◆ wifi_ap_enabled()

void sensesp::Networking::wifi_ap_enabled ( )
protected

◆ wifi_disconnected()

void sensesp::Networking::wifi_disconnected ( )
protected

◆ wifi_station_connected()

void sensesp::Networking::wifi_station_connected ( )
protected

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