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

A class for quickly configuring a SensESP application object before wiring up your sensors. More...

#include <sensesp_app_builder.h>

Inheritance diagram for sensesp::SensESPAppBuilder:
[legend]

Public Member Functions

 SensESPAppBuilder ()
 Construct a new SensESPApp Builder object.
SensESPAppBuilderset_wifi_client (String ssid, String password)
 Set the Wi-Fi network SSID and password.
SensESPAppBuilderset_wifi (String ssid, String password)
SensESPAppBuilderset_wifi_access_point (const String &ssid, const String &password)
 Set the wifi access point object SSID and password.
SensESPAppBuilderdisable_wifi ()
 Clear the default WiFi STA/AP settings.
template<typename ProvisionerConfigT>
SensESPAppBuilderset_ethernet (ProvisionerConfigT config)
 Configure the app to use a non-WiFi NetworkProvisioner.
SensESPAppBuilderset_sk_server (String address, uint16_t port)
 Set the Signal K server address and port.
SensESPAppBuilderset_hostname (String hostname) override final
 Set the device hostname.
SensESPAppBuilderset_admin_user (const char *username, const char *password)
 Set admin username and password for the web interface.
SensESPAppBuilderset_system_status_led (std::shared_ptr< SystemStatusLed > system_status_led)
 Set the system status led object.
SensESPAppBuilderenable_system_hz_sensor (String prefix=kDefaultSystemInfoSensorPrefix)
 Enable the System Hz sensor.
SensESPAppBuilderenable_free_mem_sensor (String prefix=kDefaultSystemInfoSensorPrefix)
 Enable the free memory sensor.
SensESPAppBuilderenable_uptime_sensor (String prefix=kDefaultSystemInfoSensorPrefix)
 Report the system uptime in seconds since the last reboot.
SensESPAppBuilderenable_ip_address_sensor (String prefix=kDefaultSystemInfoSensorPrefix)
 Report the IP address of the device.
SensESPAppBuilderenable_wifi_signal_sensor (String prefix=kDefaultSystemInfoSensorPrefix)
 Report the Wi-Fi signal strength.
SensESPAppBuilderset_button_pin (int pin)
 Set the button GPIO pin.
SensESPAppBuilderenable_system_info_sensors (String prefix=kDefaultSystemInfoSensorPrefix)
 Enable all built-in system info sensors.
SensESPAppBuilderenable_ota (const char *password)
 Enable over-the-air updates for the device.
SensESPAppBuilderset_wifi_manager_password (const char *password)
 Set the wifi manager password.
const SensESPAppBuilderenable_wifi_watchdog ()
std::shared_ptr< SensESPAppget_app ()
 Get the SensESPApp object.

Protected Attributes

std::shared_ptr< SensESPAppapp_
Protected Attributes inherited from sensesp::SensESPBaseAppBuilder
String hostname_ = "SensESP"

Detailed Description

A class for quickly configuring a SensESP application object before wiring up your sensors.

Definition at line 21 of file sensesp_app_builder.h.

Constructor & Destructor Documentation

◆ SensESPAppBuilder()

sensesp::SensESPAppBuilder::SensESPAppBuilder ( )
inline

Construct a new SensESPApp Builder object.

SensESPAppBuilder is used to instantiate a SensESPApp object with non-trivial configuration.

Definition at line 39 of file sensesp_app_builder.h.

Here is the caller graph for this function:

Member Function Documentation

◆ disable_wifi()

SensESPAppBuilder * sensesp::SensESPAppBuilder::disable_wifi ( )
inline

Clear the default WiFi STA/AP settings.

Intended for use by non-WiFi provisioners (Ethernet, future PPP/cellular, …) that supply a factory via SensESPApp::set_network_provisioner_factory(). Without this call, the default WiFi-construction path in SensESPApp::setup() would still produce a WiFiProvisioner alongside the non-WiFi one.

set_ethernet() calls this implicitly, so most users do not have to invoke disable_wifi() directly.

Definition at line 92 of file sensesp_app_builder.h.

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

◆ enable_free_mem_sensor()

SensESPAppBuilder * sensesp::SensESPAppBuilder::enable_free_mem_sensor ( String prefix = kDefaultSystemInfoSensorPrefix)
inline

Enable the free memory sensor.

Parameters
prefix
Returns
SensESPAppBuilder*

Definition at line 211 of file sensesp_app_builder.h.

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

◆ enable_ip_address_sensor()

SensESPAppBuilder * sensesp::SensESPAppBuilder::enable_ip_address_sensor ( String prefix = kDefaultSystemInfoSensorPrefix)
inline

Report the IP address of the device.

Parameters
prefix
Returns
SensESPAppBuilder*

Definition at line 243 of file sensesp_app_builder.h.

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

◆ enable_ota()

SensESPAppBuilder * sensesp::SensESPAppBuilder::enable_ota ( const char * password)
inline

Enable over-the-air updates for the device.

Parameters
passwordOTA authentication password.
Returns
SensESPAppBuilder*

Definition at line 302 of file sensesp_app_builder.h.

Here is the call graph for this function:

◆ enable_system_hz_sensor()

SensESPAppBuilder * sensesp::SensESPAppBuilder::enable_system_hz_sensor ( String prefix = kDefaultSystemInfoSensorPrefix)
inline

Enable the System Hz sensor.

The System Hz sensor is a built-in sensor that measures how many times the system loop is executed per second.

Parameters
prefix
Returns
SensESPAppBuilder*

Definition at line 195 of file sensesp_app_builder.h.

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

◆ enable_system_info_sensors()

SensESPAppBuilder * sensesp::SensESPAppBuilder::enable_system_info_sensors ( String prefix = kDefaultSystemInfoSensorPrefix)
inline

Enable all built-in system info sensors.

Parameters
prefix
Returns
SensESPAppBuilder*

Definition at line 286 of file sensesp_app_builder.h.

Here is the call graph for this function:

◆ enable_uptime_sensor()

SensESPAppBuilder * sensesp::SensESPAppBuilder::enable_uptime_sensor ( String prefix = kDefaultSystemInfoSensorPrefix)
inline

Report the system uptime in seconds since the last reboot.

Parameters
prefix
Returns
SensESPAppBuilder*

Definition at line 227 of file sensesp_app_builder.h.

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

◆ enable_wifi_signal_sensor()

SensESPAppBuilder * sensesp::SensESPAppBuilder::enable_wifi_signal_sensor ( String prefix = kDefaultSystemInfoSensorPrefix)
inline

Report the Wi-Fi signal strength.

Parameters
prefix
Returns
SensESPAppBuilder*

Definition at line 259 of file sensesp_app_builder.h.

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

◆ enable_wifi_watchdog()

const SensESPAppBuilder * sensesp::SensESPAppBuilder::enable_wifi_watchdog ( )
inline

Definition at line 323 of file sensesp_app_builder.h.

Here is the call graph for this function:

◆ get_app()

std::shared_ptr< SensESPApp > sensesp::SensESPAppBuilder::get_app ( )
inline

Get the SensESPApp object.

Return a SensESPApp object that has been setup.

Returns
SensESPApp*

Definition at line 349 of file sensesp_app_builder.h.

Here is the call graph for this function:

◆ set_admin_user()

SensESPAppBuilder * sensesp::SensESPAppBuilder::set_admin_user ( const char * username,
const char * password )
inline

Set admin username and password for the web interface.

Definition at line 167 of file sensesp_app_builder.h.

Here is the call graph for this function:

◆ set_button_pin()

SensESPAppBuilder * sensesp::SensESPAppBuilder::set_button_pin ( int pin)
inline

Set the button GPIO pin.

Returns
SensESPAppBuilder*

Definition at line 275 of file sensesp_app_builder.h.

Here is the call graph for this function:

◆ set_ethernet()

template<typename ProvisionerConfigT>
SensESPAppBuilder * sensesp::SensESPAppBuilder::set_ethernet ( ProvisionerConfigT config)
inline

Configure the app to use a non-WiFi NetworkProvisioner.

Today only Ethernet on ESP32-P4 is supported. Use as:

#include "sensesp/net/ethernet_provisioner.h"
...
builder.set_ethernet(EthernetConfig::waveshare_esp32p4_poe())
       ->get_app();
Template Parameters
ProvisionerConfigTa configuration struct that exposes a nested using ProvisionerType = …; typedef pointing at the concrete NetworkProvisioner implementation. EthernetConfig from sensesp/net/ethernet_provisioner.h is the only such type today. Templated so this header does not need to pull in any provisioner implementation files — users who call set_ethernet() must include the relevant provisioner header in their own translation unit.

Calling set_ethernet() on a target whose provisioner header is empty (e.g. classic ESP32, where EthernetConfig is not declared) produces a clean compile error at the use site rather than a silent runtime failure. Implicitly calls disable_wifi() so the WiFi-specific HTTP handlers and soft-AP fall-back are not registered.

Definition at line 127 of file sensesp_app_builder.h.

Here is the call graph for this function:

◆ set_hostname()

SensESPAppBuilder * sensesp::SensESPAppBuilder::set_hostname ( String hostname)
inlinefinaloverridevirtual

Set the device hostname.

If not set, the device hostname is set to "SensESP".

Parameters
hostname
Returns
SensESPAppBuilder*

Implements sensesp::SensESPBaseAppBuilder.

Definition at line 159 of file sensesp_app_builder.h.

Here is the call graph for this function:

◆ set_sk_server()

SensESPAppBuilder * sensesp::SensESPAppBuilder::set_sk_server ( String address,
uint16_t port )
inline

Set the Signal K server address and port.

If not set, mDNS is used to discover the Signal K server.

Parameters
address
port
Returns
SensESPAppBuilder*

Definition at line 146 of file sensesp_app_builder.h.

Here is the call graph for this function:

◆ set_system_status_led()

SensESPAppBuilder * sensesp::SensESPAppBuilder::set_system_status_led ( std::shared_ptr< SystemStatusLed > system_status_led)
inline

Set the system status led object.

This allows custom status LED patterns to be used.

Parameters
system_status_led
Returns
SensESPAppBuilder*

Definition at line 181 of file sensesp_app_builder.h.

Here is the call graph for this function:

◆ set_wifi()

SensESPAppBuilder * sensesp::SensESPAppBuilder::set_wifi ( String ssid,
String password )
inline

Definition at line 60 of file sensesp_app_builder.h.

Here is the call graph for this function:

◆ set_wifi_access_point()

SensESPAppBuilder * sensesp::SensESPAppBuilder::set_wifi_access_point ( const String & ssid,
const String & password )
inline

Set the wifi access point object SSID and password.

To disable the SSID, set both to empty strings.

Parameters
ssid
password
Returns
SensESPAppBuilder*

Definition at line 73 of file sensesp_app_builder.h.

Here is the call graph for this function:

◆ set_wifi_client()

SensESPAppBuilder * sensesp::SensESPAppBuilder::set_wifi_client ( String ssid,
String password )
inline

Set the Wi-Fi network SSID and password.

If not set, WiFiManager is used to create an access point for configuring the settings.

Parameters
ssid
password
Returns
SensESPAppBuilder*

Definition at line 53 of file sensesp_app_builder.h.

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

◆ set_wifi_manager_password()

SensESPAppBuilder * sensesp::SensESPAppBuilder::set_wifi_manager_password ( const char * password)
inline

Set the wifi manager password.

Set the password for the WiFi configuration access point that is enabled after device reset if no wifi configuration is provided in the application code.

Parameters
password
Returns
SensESPAppBuilder*

Definition at line 318 of file sensesp_app_builder.h.

Here is the call graph for this function:

Member Data Documentation

◆ app_

std::shared_ptr<SensESPApp> sensesp::SensESPAppBuilder::app_
protected

Definition at line 30 of file sensesp_app_builder.h.


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