SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
sensesp_base_app.cpp
Go to the documentation of this file.
1#include "sensesp_base_app.h"
2
3namespace sensesp {
4
6 Serial.begin(baudrate);
7
8 // A small delay and one debugI() are required so that
9 // the serial output displays everything
10#ifndef DEBUG_DISABLED
11 delay(100);
12 Debug.setSerialEnabled(true);
13 delay(100);
14#endif
15 debugI("\nSerial debugging enabled");
16}
17
18SensESPBaseApp* SensESPBaseApp::instance_ = nullptr;
19
21 // create the hostname_ observable - this needs to be done before
22 // the builder methods are called
24}
25
31
40 // initialize the filesystem
41 filesystem_ = new Filesystem();
42
43 // create a remote debugger object
45}
46
48 // start all individual startable components
49
50 debugI("Starting subsystems");
52 debugD("All sensors and transforms started");
53}
54
56 debugW("Resetting the device configuration to system defaults.");
58
59 ReactESP::app->onDelay(1000, []() {
60 ESP.restart();
61 delay(1000);
62 });
63}
64
68
75 return SensESPBaseApp::get()->get_hostname_observable()->get();
76}
77
78} // namespace sensesp
Initialize logging/debug output.
Construct a new transform based on a single function.
static void reset_all()
The base class for SensESP applications.
static SensESPBaseApp * get()
Get the singleton instance of the SensESPBaseApp.
virtual void reset()
Reset the device to factory defaults.
ObservableValue< String > * hostname_
static SensESPBaseApp * instance_
static String get_hostname()
Get the current hostname.
virtual void start()
Start the app (activate all the subcomponents)
SensESPBaseApp()
Construct a new SensESP Base App object.
virtual void setup()
Perform initialization of SensESPBaseApp once builder configuration is done.
ObservableValue< String > * get_hostname_observable()
Get the hostname observable object.
static void start_all()
Definition startable.cpp:14
virtual const T & get() const
#define debugI(fmt,...)
Definition local_debug.h:48
#define debugD(fmt,...)
Definition local_debug.h:47
#define debugW(fmt,...)
Definition local_debug.h:49
DEBUG_CLASS Debug
constexpr auto kDefaultHostname
void SetupSerialDebug(uint32_t baudrate)