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

#include <sensesp_app.h>

Inheritance diagram for sensesp::SensESPApp:
[legend]

Public Member Functions

 SensESPApp (SensESPApp &other)=delete
 
void operator= (const SensESPApp &)=delete
 
virtual bool destroy () override
 Destroy the SensESPBaseApp instance.
 
std::shared_ptr< SKDeltaQueueget_sk_delta ()
 
std::shared_ptr< SystemStatusControllerget_system_status_controller ()
 
std::shared_ptr< Networking > & get_networking ()
 
std::shared_ptr< SKWSClientget_ws_client ()
 
- Public Member Functions inherited from sensesp::SensESPBaseApp
virtual void start ()
 Start the app (activate all the subcomponents)
 
virtual void reset ()
 Reset the device to factory defaults.
 
std::shared_ptr< ObservableValue< String > > get_hostname_observable ()
 Get the hostname observable object.
 

Static Public Member Functions

static std::shared_ptr< SensESPAppget ()
 Get the singleton instance of the SensESPApp.
 
- Static Public Member Functions inherited from sensesp::SensESPBaseApp
static const std::shared_ptr< SensESPBaseApp > & get ()
 Get the singleton instance of the SensESPBaseApp.
 
static String get_hostname ()
 Get the current hostname.
 
static std::shared_ptr< reactesp::EventLoop > get_event_loop ()
 Get the event loop object from the singleton SensESPBaseApp instance.
 

Protected Member Functions

 SensESPApp ()
 SensESPApp constructor.
 
const SensESPAppset_hostname (String hostname)
 
const SensESPAppset_ssid (String ssid)
 
const SensESPAppset_wifi_password (String wifi_password)
 
const SensESPAppset_ap_ssid (const String &ssid)
 
const SensESPAppset_ap_password (const String &password)
 
const SensESPAppset_sk_server_address (String sk_server_address)
 
const SensESPAppset_sk_server_port (uint16_t sk_server_port)
 
const SensESPAppset_system_status_led (std::shared_ptr< SystemStatusLed > &system_status_led)
 
const SensESPAppset_admin_user (const char *username, const char *password)
 
const SensESPAppenable_ota (const char *password)
 
const SensESPAppset_button_pin (int pin)
 
void setup ()
 Perform initialization of SensESPApp once builder configuration is done.
 
void connect_status_page_items ()
 
- Protected Member Functions inherited from sensesp::SensESPBaseApp
 SensESPBaseApp ()
 Construct a new SensESP Base App object.
 
 ~SensESPBaseApp ()
 
void init_hostname ()
 
void set_instance (const std::shared_ptr< SensESPBaseApp > &instance)
 
const SensESPBaseAppset_hostname (String hostname)
 

Protected Attributes

String ssid_ = ""
 
String wifi_client_password_ = ""
 
String sk_server_address_ = ""
 
uint16_t sk_server_port_ = 0
 
String ap_ssid_ = ""
 
String ap_password_ = "thisisfine"
 
const char * ota_password_ = nullptr
 
std::shared_ptr< MDNSDiscoverymdns_discovery_
 
std::shared_ptr< HTTPServerhttp_server_
 
std::shared_ptr< SystemStatusLedsystem_status_led_
 
std::shared_ptr< SystemStatusControllersystem_status_controller_
 
int button_gpio_pin_ = SENSESP_BUTTON_PIN
 
std::shared_ptr< ButtonHandlerbutton_handler_
 
std::shared_ptr< Networkingnetworking_
 
std::shared_ptr< OTAota_
 
std::shared_ptr< SKDeltaQueuesk_delta_queue_
 
std::shared_ptr< SKWSClientws_client_
 
StatusPageItem< int > free_memory_ui_output_
 
StatusPageItem< int > uptime_ui_output_ {"Uptime (s)", 0, "System", 1100}
 
StatusPageItem< String > hostname_ui_output_ {"Hostname", "", "Network", 1200}
 
StatusPageItem< String > mac_address_ui_output_
 
StatusPageItem< String > wifi_ssid_ui_output_ {"SSID", "", "Network", 1400}
 
StatusPageItem< int8_t > wifi_rssi_ui_output_
 
StatusPageItem< String > sk_server_address_ui_output_
 
StatusPageItem< uint16_t > sk_server_port_ui_output_
 
StatusPageItem< String > sk_server_connection_ui_output_
 
StatusPageItem< int > delta_tx_count_ui_output_
 
StatusPageItem< int > delta_rx_count_ui_output_
 
StatusPageItem< int > event_loop_queue_size_ui_output_
 
StatusPageItem< int > event_loop_timed_queue_ui_output_
 
StatusPageItem< int > event_loop_untimed_queue_ui_output_
 
StatusPageItem< int > event_loop_interrupt_queue_ui_output_
 
StatusPageItem< uint64_t > total_tick_count_ui_output_
 
StatusPageItem< uint64_t > event_count_ui_output_
 
StatusPageItem< uint64_t > timed_event_count_ui_output_
 
StatusPageItem< uint64_t > untimed_event_count_ui_output_
 
StatusPageItem< float > ticks_per_second_ui_output_
 
StatusPageItem< float > events_per_second_ui_output_
 
StatusPageItem< float > timed_events_per_second_ui_output_
 
StatusPageItem< float > untimed_events_per_second_ui_output_
 
StatusPageItem< String > sensesp_version_ui_output_
 
StatusPageItem< String > build_info_ui_output_
 
std::shared_ptr< ValueProducer< float > > system_hz_sensor_
 
std::shared_ptr< ValueProducer< uint32_t > > free_mem_sensor_
 
std::shared_ptr< ValueProducer< float > > uptime_sensor_
 
std::shared_ptr< ValueProducer< String > > ip_address_sensor_
 
std::shared_ptr< ValueProducer< int > > wifi_signal_sensor_
 
- Protected Attributes inherited from sensesp::SensESPBaseApp
std::shared_ptr< reactesp::EventLoop > event_loop_
 
std::shared_ptr< PersistingObservableValue< String > > hostname_
 
std::shared_ptr< Filesystemfilesystem_
 

Friends

class WebServer
 
class SensESPAppBuilder
 

Additional Inherited Members

- Static Protected Attributes inherited from sensesp::SensESPBaseApp
static std::shared_ptr< SensESPBaseAppinstance_ = nullptr
 

Detailed Description

The default SensESP application object with networking and Signal K communication.

See also
SensESPAppBuilder

Definition at line 42 of file sensesp_app.h.

Constructor & Destructor Documentation

◆ SensESPApp() [1/2]

sensesp::SensESPApp::SensESPApp ( SensESPApp & other)
delete

Singletons should not be cloneable

◆ SensESPApp() [2/2]

sensesp::SensESPApp::SensESPApp ( )
inlineprotected

SensESPApp constructor.

Note that the constructor is protected, so SensESPApp should only be instantiated using SensESPAppBuilder.

Definition at line 94 of file sensesp_app.h.

Here is the caller graph for this function:

Member Function Documentation

◆ connect_status_page_items()

void sensesp::SensESPApp::connect_status_page_items ( )
inlineprotected

Definition at line 223 of file sensesp_app.h.

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

◆ destroy()

virtual bool sensesp::SensESPApp::destroy ( )
inlineoverridevirtual

Destroy the SensESPBaseApp instance.

Reimplemented from sensesp::SensESPBaseApp.

Definition at line 64 of file sensesp_app.h.

◆ enable_ota()

const SensESPApp * sensesp::SensESPApp::enable_ota ( const char * password)
inlineprotected

Definition at line 135 of file sensesp_app.h.

◆ get()

static std::shared_ptr< SensESPApp > sensesp::SensESPApp::get ( )
inlinestatic

Get the singleton instance of the SensESPApp.

Definition at line 57 of file sensesp_app.h.

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

◆ get_networking()

std::shared_ptr< Networking > & sensesp::SensESPApp::get_networking ( )
inline

Definition at line 83 of file sensesp_app.h.

◆ get_sk_delta()

std::shared_ptr< SKDeltaQueue > sensesp::SensESPApp::get_sk_delta ( )
inline

Definition at line 79 of file sensesp_app.h.

◆ get_system_status_controller()

std::shared_ptr< SystemStatusController > sensesp::SensESPApp::get_system_status_controller ( )
inline

Definition at line 80 of file sensesp_app.h.

◆ get_ws_client()

std::shared_ptr< SKWSClient > sensesp::SensESPApp::get_ws_client ( )
inline

Definition at line 84 of file sensesp_app.h.

◆ operator=()

void sensesp::SensESPApp::operator= ( const SensESPApp & )
delete

Singletons should not be assignable

◆ set_admin_user()

const SensESPApp * sensesp::SensESPApp::set_admin_user ( const char * username,
const char * password )
inlineprotected

Definition at line 131 of file sensesp_app.h.

◆ set_ap_password()

const SensESPApp * sensesp::SensESPApp::set_ap_password ( const String & password)
inlineprotected

Definition at line 114 of file sensesp_app.h.

◆ set_ap_ssid()

const SensESPApp * sensesp::SensESPApp::set_ap_ssid ( const String & ssid)
inlineprotected

Definition at line 110 of file sensesp_app.h.

◆ set_button_pin()

const SensESPApp * sensesp::SensESPApp::set_button_pin ( int pin)
inlineprotected

Definition at line 139 of file sensesp_app.h.

◆ set_hostname()

const SensESPApp * sensesp::SensESPApp::set_hostname ( String hostname)
inlineprotected

Definition at line 98 of file sensesp_app.h.

Here is the call graph for this function:

◆ set_sk_server_address()

const SensESPApp * sensesp::SensESPApp::set_sk_server_address ( String sk_server_address)
inlineprotected

Definition at line 118 of file sensesp_app.h.

◆ set_sk_server_port()

const SensESPApp * sensesp::SensESPApp::set_sk_server_port ( uint16_t sk_server_port)
inlineprotected

Definition at line 122 of file sensesp_app.h.

◆ set_ssid()

const SensESPApp * sensesp::SensESPApp::set_ssid ( String ssid)
inlineprotected

Definition at line 102 of file sensesp_app.h.

◆ set_system_status_led()

const SensESPApp * sensesp::SensESPApp::set_system_status_led ( std::shared_ptr< SystemStatusLed > & system_status_led)
inlineprotected

Definition at line 126 of file sensesp_app.h.

◆ set_wifi_password()

const SensESPApp * sensesp::SensESPApp::set_wifi_password ( String wifi_password)
inlineprotected

Definition at line 106 of file sensesp_app.h.

◆ setup()

void sensesp::SensESPApp::setup ( )
inlineprotectedvirtual

Perform initialization of SensESPApp once builder configuration is done.

This should be only called from the builder!

Reimplemented from sensesp::SensESPBaseApp.

Definition at line 151 of file sensesp_app.h.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ SensESPAppBuilder

friend class SensESPAppBuilder
friend

Definition at line 383 of file sensesp_app.h.

◆ WebServer

friend class WebServer
friend

Definition at line 382 of file sensesp_app.h.

Member Data Documentation

◆ ap_password_

String sensesp::SensESPApp::ap_password_ = "thisisfine"
protected

Definition at line 303 of file sensesp_app.h.

◆ ap_ssid_

String sensesp::SensESPApp::ap_ssid_ = ""
protected

Definition at line 302 of file sensesp_app.h.

◆ build_info_ui_output_

StatusPageItem<String> sensesp::SensESPApp::build_info_ui_output_
protected
Initial value:
{
"Build date", __DATE__ " " __TIME__, "Software", 3400}

Definition at line 372 of file sensesp_app.h.

◆ button_gpio_pin_

int sensesp::SensESPApp::button_gpio_pin_ = SENSESP_BUTTON_PIN
protected

Definition at line 312 of file sensesp_app.h.

◆ button_handler_

std::shared_ptr<ButtonHandler> sensesp::SensESPApp::button_handler_
protected

Definition at line 313 of file sensesp_app.h.

◆ delta_rx_count_ui_output_

StatusPageItem<int> sensesp::SensESPApp::delta_rx_count_ui_output_
protected
Initial value:
{"SK Delta RX count", 0,
"Signal K", 2000}

Definition at line 341 of file sensesp_app.h.

◆ delta_tx_count_ui_output_

StatusPageItem<int> sensesp::SensESPApp::delta_tx_count_ui_output_
protected
Initial value:
{"SK Delta TX count", 0,
"Signal K", 1900}

Definition at line 339 of file sensesp_app.h.

◆ event_count_ui_output_

StatusPageItem<uint64_t> sensesp::SensESPApp::event_count_ui_output_
protected
Initial value:
{"Events processed", 0,
"Event Loop Lifetime", 2600}

Definition at line 355 of file sensesp_app.h.

◆ event_loop_interrupt_queue_ui_output_

StatusPageItem<int> sensesp::SensESPApp::event_loop_interrupt_queue_ui_output_
protected
Initial value:
{
"Event Loop interrupt queue size", 0, "Event Loop Queues", 2400}

Definition at line 350 of file sensesp_app.h.

◆ event_loop_queue_size_ui_output_

StatusPageItem<int> sensesp::SensESPApp::event_loop_queue_size_ui_output_
protected
Initial value:
{
"Event Loop queue size", 0, "Event Loop Queues", 2100}

Definition at line 344 of file sensesp_app.h.

◆ event_loop_timed_queue_ui_output_

StatusPageItem<int> sensesp::SensESPApp::event_loop_timed_queue_ui_output_
protected
Initial value:
{
"Event Loop timed queue size", 0, "Event Loop Queues", 2200}

Definition at line 346 of file sensesp_app.h.

◆ event_loop_untimed_queue_ui_output_

StatusPageItem<int> sensesp::SensESPApp::event_loop_untimed_queue_ui_output_
protected
Initial value:
{
"Event Loop untimed queue size", 0, "Event Loop Queues", 2300}

Definition at line 348 of file sensesp_app.h.

◆ events_per_second_ui_output_

StatusPageItem<float> sensesp::SensESPApp::events_per_second_ui_output_
protected
Initial value:
{
"Events per second", 0, "Event Loop Performance", 3000}

Definition at line 363 of file sensesp_app.h.

◆ free_mem_sensor_

std::shared_ptr<ValueProducer<uint32_t> > sensesp::SensESPApp::free_mem_sensor_
protected

Definition at line 377 of file sensesp_app.h.

◆ free_memory_ui_output_

StatusPageItem<int> sensesp::SensESPApp::free_memory_ui_output_
protected
Initial value:
{"Free memory (bytes)", 0, "System",
1000}

Definition at line 321 of file sensesp_app.h.

◆ hostname_ui_output_

StatusPageItem<String> sensesp::SensESPApp::hostname_ui_output_ {"Hostname", "", "Network", 1200}
protected

Definition at line 325 of file sensesp_app.h.

◆ http_server_

std::shared_ptr<HTTPServer> sensesp::SensESPApp::http_server_
protected

Definition at line 307 of file sensesp_app.h.

◆ ip_address_sensor_

std::shared_ptr<ValueProducer<String> > sensesp::SensESPApp::ip_address_sensor_
protected

Definition at line 379 of file sensesp_app.h.

◆ mac_address_ui_output_

StatusPageItem<String> sensesp::SensESPApp::mac_address_ui_output_
protected
Initial value:
{
"MAC Address", WiFi.macAddress(), "Network", 1300}

Definition at line 326 of file sensesp_app.h.

◆ mdns_discovery_

std::shared_ptr<MDNSDiscovery> sensesp::SensESPApp::mdns_discovery_
protected

Definition at line 306 of file sensesp_app.h.

◆ networking_

std::shared_ptr<Networking> sensesp::SensESPApp::networking_
protected

Definition at line 315 of file sensesp_app.h.

◆ ota_

std::shared_ptr<OTA> sensesp::SensESPApp::ota_
protected

Definition at line 317 of file sensesp_app.h.

◆ ota_password_

const char* sensesp::SensESPApp::ota_password_ = nullptr
protected

Definition at line 304 of file sensesp_app.h.

◆ sensesp_version_ui_output_

StatusPageItem<String> sensesp::SensESPApp::sensesp_version_ui_output_
protected
Initial value:
{
"SenseESP version", kSensESPVersion, "Software", 3300}
const char *const kSensESPVersion

Definition at line 370 of file sensesp_app.h.

◆ sk_delta_queue_

std::shared_ptr<SKDeltaQueue> sensesp::SensESPApp::sk_delta_queue_
protected

Definition at line 318 of file sensesp_app.h.

◆ sk_server_address_

String sensesp::SensESPApp::sk_server_address_ = ""
protected

Definition at line 300 of file sensesp_app.h.

◆ sk_server_address_ui_output_

StatusPageItem<String> sensesp::SensESPApp::sk_server_address_ui_output_
protected
Initial value:
{"Signal K server address",
"", "Signal K", 1600}

Definition at line 333 of file sensesp_app.h.

◆ sk_server_connection_ui_output_

StatusPageItem<String> sensesp::SensESPApp::sk_server_connection_ui_output_
protected
Initial value:
{"SK connection status",
"", "Signal K", 1800}

Definition at line 337 of file sensesp_app.h.

◆ sk_server_port_

uint16_t sensesp::SensESPApp::sk_server_port_ = 0
protected

Definition at line 301 of file sensesp_app.h.

◆ sk_server_port_ui_output_

StatusPageItem<uint16_t> sensesp::SensESPApp::sk_server_port_ui_output_
protected
Initial value:
{"Signal K server port", 0,
"Signal K", 1700}

Definition at line 335 of file sensesp_app.h.

◆ ssid_

String sensesp::SensESPApp::ssid_ = ""
protected

Definition at line 298 of file sensesp_app.h.

◆ system_hz_sensor_

std::shared_ptr<ValueProducer<float> > sensesp::SensESPApp::system_hz_sensor_
protected

Definition at line 376 of file sensesp_app.h.

◆ system_status_controller_

std::shared_ptr<SystemStatusController> sensesp::SensESPApp::system_status_controller_
protected
Initial value:
=
std::make_shared<SystemStatusController>()

Definition at line 310 of file sensesp_app.h.

◆ system_status_led_

std::shared_ptr<SystemStatusLed> sensesp::SensESPApp::system_status_led_
protected

Definition at line 309 of file sensesp_app.h.

◆ ticks_per_second_ui_output_

StatusPageItem<float> sensesp::SensESPApp::ticks_per_second_ui_output_
protected
Initial value:
{
"Ticks per second", 0, "Event Loop Performance", 2900}

Definition at line 361 of file sensesp_app.h.

◆ timed_event_count_ui_output_

StatusPageItem<uint64_t> sensesp::SensESPApp::timed_event_count_ui_output_
protected
Initial value:
{
"Timed events processed", 0, "Event Loop Lifetime", 2700}

Definition at line 357 of file sensesp_app.h.

◆ timed_events_per_second_ui_output_

StatusPageItem<float> sensesp::SensESPApp::timed_events_per_second_ui_output_
protected
Initial value:
{
"Timed events per second", 0, "Event Loop Performance", 3100}

Definition at line 365 of file sensesp_app.h.

◆ total_tick_count_ui_output_

StatusPageItem<uint64_t> sensesp::SensESPApp::total_tick_count_ui_output_
protected
Initial value:
{
"Total ticks processed", 0, "Event Loop Lifetime", 2500}

Definition at line 353 of file sensesp_app.h.

◆ untimed_event_count_ui_output_

StatusPageItem<uint64_t> sensesp::SensESPApp::untimed_event_count_ui_output_
protected
Initial value:
{
"Untimed events processed", 0, "Event Loop Lifetime", 2800}

Definition at line 359 of file sensesp_app.h.

◆ untimed_events_per_second_ui_output_

StatusPageItem<float> sensesp::SensESPApp::untimed_events_per_second_ui_output_
protected
Initial value:
{
"Untimed events per second", 0, "Event Loop Performance", 3200}

Definition at line 367 of file sensesp_app.h.

◆ uptime_sensor_

std::shared_ptr<ValueProducer<float> > sensesp::SensESPApp::uptime_sensor_
protected

Definition at line 378 of file sensesp_app.h.

◆ uptime_ui_output_

StatusPageItem<int> sensesp::SensESPApp::uptime_ui_output_ {"Uptime (s)", 0, "System", 1100}
protected

Definition at line 323 of file sensesp_app.h.

◆ wifi_client_password_

String sensesp::SensESPApp::wifi_client_password_ = ""
protected

Definition at line 299 of file sensesp_app.h.

◆ wifi_rssi_ui_output_

StatusPageItem<int8_t> sensesp::SensESPApp::wifi_rssi_ui_output_
protected
Initial value:
{"WiFi signal strength (dB)", -128,
"Network", 1500}

Definition at line 330 of file sensesp_app.h.

◆ wifi_signal_sensor_

std::shared_ptr<ValueProducer<int> > sensesp::SensESPApp::wifi_signal_sensor_
protected

Definition at line 380 of file sensesp_app.h.

◆ wifi_ssid_ui_output_

StatusPageItem<String> sensesp::SensESPApp::wifi_ssid_ui_output_ {"SSID", "", "Network", 1400}
protected

Definition at line 328 of file sensesp_app.h.

◆ ws_client_

std::shared_ptr<SKWSClient> sensesp::SensESPApp::ws_client_
protected

Definition at line 319 of file sensesp_app.h.


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