From 347d9094a230696ab7e66bb3a12480d7d26cf566 Mon Sep 17 00:00:00 2001 From: cziter15 Date: Mon, 1 Apr 2024 20:10:14 +0000 Subject: [PATCH] deploy: 23bb494c5669ae98e4892f2dde476a9c99893d51 --- annotated.html | 22 +- classksf_1_1comps_1_1ks_config_provider.html | 40 +-- ..._1_1ks_dev_stat_mqtt_reporter-members.html | 2 +- ...1_1comps_1_1ks_dev_stat_mqtt_reporter.html | 69 ++++-- ..._1_1comps_1_1ks_device_portal-members.html | 2 +- classksf_1_1comps_1_1ks_device_portal.html | 228 ++++++++++++------ classksf_1_1comps_1_1ks_led.html | 26 +- ...f_1_1comps_1_1ks_mqtt_config_provider.html | 34 +-- ...1_1comps_1_1ks_mqtt_connector-members.html | 4 +- classksf_1_1comps_1_1ks_mqtt_connector.html | 48 ++-- classksf_1_1comps_1_1ks_reset_button.html | 28 +-- ...comps_1_1ks_wifi_configurator-members.html | 30 +-- ...sksf_1_1comps_1_1ks_wifi_configurator.html | 89 ++++--- classksf_1_1comps_1_1ks_wifi_connector.html | 66 +++-- classksf_1_1ks_app_rotator.html | 20 +- classksf_1_1ks_application.html | 67 +++-- classksf_1_1ks_cert_fingerprint.html | 10 +- classksf_1_1ks_component.html | 58 +++-- classksf_1_1ks_config.html | 67 ++--- classksf_1_1ks_rtti.html | 51 ++-- classksf_1_1ks_simple_timer.html | 24 +- classksf_1_1misc_1_1ks_w_s_server.html | 33 +-- doxygen_crawl.html | 9 + functions.html | 2 +- functions_func.html | 7 +- functions_i.html | 2 +- functions_k.html | 1 + functions_o.html | 3 +- functions_p.html | 2 +- functions_vars.html | 3 +- hierarchy.html | 22 +- ks_app_rotator_8h_source.html | 96 ++++---- ks_application_8h_source.html | 143 +++++------ ks_cert_utils_8h_source.html | 78 +++--- ks_component_8h_source.html | 44 ++-- ks_config_8h_source.html | 56 ++--- ks_config_provider_8h_source.html | 91 +++---- ks_constants_8h_source.html | 120 ++++----- ks_dev_stat_mqtt_reporter_8h_source.html | 23 +- ks_device_portal_8h_source.html | 199 +++++++-------- ks_led_8h_source.html | 4 +- ks_mqtt_config_provider_8h_source.html | 2 +- ks_mqtt_connector_8h_source.html | 178 +++++++------- ks_reset_button_8h_source.html | 4 +- ks_rtti_8h_source.html | 114 ++++----- ks_simple_timer_8h_source.html | 48 ++-- ks_w_s_server_8h_source.html | 42 ++-- ks_wifi_configurator_8h_source.html | 68 +++--- ks_wifi_connector_8h_source.html | 96 ++++---- menudata.js | 6 + namespaceksf_1_1_e_o_t_a_type.html | 129 ++++++++++ ...eksf_1_1comps_1_1_e_config_param_type.html | 104 ++++++++ namespacemembers.html | 86 +++++++ namespacemembers_enum.html | 83 +++++++ namespacemembers_eval.html | 85 +++++++ namespaces.html | 85 +++++++ search/all_0.js | 2 +- search/all_10.js | 22 +- search/all_11.js | 10 +- search/all_12.js | 7 +- search/all_13.js | 15 +- search/all_14.js | 23 +- search/all_15.js | 12 + search/all_8.js | 2 +- search/all_9.js | 24 +- search/all_c.js | 16 +- search/all_d.js | 25 +- search/all_e.js | 22 +- search/all_f.js | 32 +-- search/enums_0.js | 4 + search/enumvalues_0.js | 4 + search/enumvalues_1.js | 5 + search/functions_6.js | 2 +- search/functions_7.js | 17 +- search/functions_a.js | 2 +- search/functions_b.js | 2 +- search/namespaces_0.js | 5 + search/searchdata.js | 29 ++- search/variables_0.js | 2 +- search/variables_9.js | 3 +- ...ctksf_1_1comps_1_1ks_config_parameter.html | 2 +- 81 files changed, 2098 insertions(+), 1244 deletions(-) create mode 100644 namespaceksf_1_1_e_o_t_a_type.html create mode 100644 namespaceksf_1_1comps_1_1_e_config_param_type.html create mode 100644 namespacemembers.html create mode 100644 namespacemembers_enum.html create mode 100644 namespacemembers_eval.html create mode 100644 namespaces.html create mode 100644 search/all_15.js create mode 100644 search/enums_0.js create mode 100644 search/enumvalues_0.js create mode 100644 search/enumvalues_1.js create mode 100644 search/namespaces_0.js diff --git a/annotated.html b/annotated.html index c4b32f7..9a77df6 100644 --- a/annotated.html +++ b/annotated.html @@ -79,28 +79,28 @@  Nksf  Ncomps  CksConfigParameterA structure that defines configuration parameter - CksConfigProviderA component that provides a set of parameters to the ksWifiConfigurator and is also responsible for handling its storage - CksDevicePortal + CksConfigProviderA component that provides a set of parameters to the ksWifiConfigurator and is also responsible for handling its storage + CksDevicePortalA component thet implements web-based configuration portal accessible from local network  CksDevStatMqttReporterA component that periodocally reports device state to the broker  CksLedA component that simplifies driving the LED  CksMqttConfigProviderA component that manages MQTT-related configuration  CksMqttConnectorA component which is responsible for MQTT connection management  CksResetButtonA component that implements reset button functionality - CksWifiConfigurator - CksWifiConnector + CksWifiConfiguratorKsWifiConfigurator component class + CksWifiConnectorA component that manages WiFi connection  Nevt  CksEvent  CksEventHandle  CksEventInterface  Nmisc  CksWSServer - CksApplication - CksAppRotator - CksCertFingerprint - CksComponent - CksConfig - CksRtti - CksSimpleTimer + CksApplicationA class that is a base for user-defined application + CksAppRotatorApplication rotator component + CksCertFingerprintInterface for certificate fingerprint verification + CksComponentBase component class + CksConfigImplements low-level configuration file handling + CksRttiImplements RTTI (run-time type information) for objects + CksSimpleTimerSimple timer class, without using component architecture  Nlogger  CColors diff --git a/classksf_1_1comps_1_1ks_config_provider.html b/classksf_1_1comps_1_1ks_config_provider.html index b0e163b..ba2f654 100644 --- a/classksf_1_1comps_1_1ks_config_provider.html +++ b/classksf_1_1comps_1_1ks_config_provider.html @@ -85,7 +85,7 @@
-

A component that provides a set of parameters to the ksWifiConfigurator and is also responsible for handling its storage. +

A component that provides a set of parameters to the ksWifiConfigurator and is also responsible for handling its storage. More...

#include <ksConfigProvider.h>

@@ -97,8 +97,8 @@
-ksf::ksComponent -ksf::ksRtti +ksf::ksComponent +ksf::ksRtti ksf::comps::ksMqttConfigProvider
@@ -106,10 +106,10 @@

Public Member Functions

virtual const size_t getInstanceType () const - This function is used to get type ID of object.
+ Retrieves type ID of the object.
  virtual bool isA (const size_t id) const - This function is used to check if object is of given type.
+ Checks whether object is of given type.
  std::list< ksConfigParameter > & getParameters () @@ -126,19 +126,19 @@  Initializes component.
  virtual bool loop (ksApplication *app) - Called from application loop.
+ Handles component loop logic, called from application loop.
  virtual bool postInit (ksApplication *app) - Method called after component initialization.
+ Method called after component initialization, used to setup references to other components.
  - Public Member Functions inherited from ksf::ksRtti template<typename TType > TType * as () - This function is used to cast object to given type.
+ Tries to cast object to the type provided as a template parameter.
  template<typename TType > const TType * as () const - This function is used to const cast object to given type.
+ Tries to cast object to the type provided as a template parameter (const version).
 

@@ -153,10 +153,10 @@

- + - +

Protected Member Functions

void addNewParam (std::string id, std::string value, int maxLength=50, EConfigParamType::Type type={})
void addNewParam (std::string id, std::string value, int maxLength=50, EConfigParamType::Type type={})
 Defines new configutation parameter.
 
void addNewParamWithConfigDefault (ksConfig &config, std::string id, int maxLength=50, EConfigParamType::Type type={})
void addNewParamWithConfigDefault (ksConfig &config, std::string id, int maxLength=50, EConfigParamType::Type type={})
 Defines new configuation parameter (with default value).
 
@@ -170,8 +170,8 @@
 

Detailed Description

-

A component that provides a set of parameters to the ksWifiConfigurator and is also responsible for handling its storage.

-

In the configurator application, it should be instantiated like a typical component, and ksWifiConfigurator must be added to the component stack. In this case, it will manage the correct flow of data reading and saving.

+

A component that provides a set of parameters to the ksWifiConfigurator and is also responsible for handling its storage.

+

In the configurator application, it should be instantiated like a typical component, and ksWifiConfigurator must be added to the component stack. In this case, it will manage the correct flow of data reading and saving.

In contrast, in a normal application, it can be created for a short period of time, usually inside the application's init method, to read the data and return the required value. Refer to the EnergySensor init method for an example. Note that the component will be destroyed upon reaching the function return. Also, note that the setupRotations method can return false in case of a problem with the value retrieval (for example, no config present yet), thus causing the application to break and triggering the app rotator to move to the next defined application, usually AP-based configurator.

Member Function Documentation

@@ -201,7 +201,7 @@

- EConfigParamType::Type type = {} ) + EConfigParamType::Type type = {} ) @@ -253,7 +253,7 @@

- EConfigParamType::Type type = {} ) + EConfigParamType::Type type = {} ) @@ -266,7 +266,7 @@

Parameters
- + @@ -305,8 +305,8 @@

-

This function is used to get type ID of object.

-
Returns
Type ID.
+

Retrieves type ID of the object.

+
Returns
Object type ID.

Reimplemented from ksf::ksComponent.

@@ -337,10 +337,10 @@

-

This function is used to check if object is of given type.

+

Checks whether object is of given type.

Parameters

configksConfig reference.
configksConfig reference.
idUnique identificator that will be also used as property label by Device Portal.
valueDefault parameter value.
maxLengthMaximum length of the value.
- +
idType ID.
idType ID to check against.
diff --git a/classksf_1_1comps_1_1ks_dev_stat_mqtt_reporter-members.html b/classksf_1_1comps_1_1ks_dev_stat_mqtt_reporter-members.html index 0df64e5..f9aee79 100644 --- a/classksf_1_1comps_1_1ks_dev_stat_mqtt_reporter-members.html +++ b/classksf_1_1comps_1_1ks_dev_stat_mqtt_reporter-members.html @@ -89,7 +89,7 @@ getInstanceType() constksf::comps::ksDevStatMqttReporterinlinevirtual init(ksApplication *app)ksf::ksComponentvirtual isA(const size_t id) constksf::comps::ksDevStatMqttReporterinlinevirtual - ksDevStatMqttReporter(uint8_t intervalInSeconds=60) (defined in ksf::comps::ksDevStatMqttReporter)ksf::comps::ksDevStatMqttReporter + ksDevStatMqttReporter(uint8_t intervalInSeconds=60)ksf::comps::ksDevStatMqttReporter loop(ksApplication *app) overrideksf::comps::ksDevStatMqttReportervirtual mqttConnWpksf::comps::ksDevStatMqttReporterprotected onConnected()ksf::comps::ksDevStatMqttReporterprotected diff --git a/classksf_1_1comps_1_1ks_dev_stat_mqtt_reporter.html b/classksf_1_1comps_1_1ks_dev_stat_mqtt_reporter.html index 93e7ed3..1f1ccb1 100644 --- a/classksf_1_1comps_1_1ks_dev_stat_mqtt_reporter.html +++ b/classksf_1_1comps_1_1ks_dev_stat_mqtt_reporter.html @@ -97,21 +97,21 @@
-ksf::ksComponent -ksf::ksRtti +ksf::ksComponent +ksf::ksRtti

- + - + - + + @@ -126,11 +126,11 @@ - + - +

Public Member Functions

virtual const size_t getInstanceType () const
 This function is used to get type ID of object.
 Retrieves type ID of the object.
 
virtual bool isA (const size_t id) const
 This function is used to check if object is of given type.
 Checks whether object is of given type.
 
ksDevStatMqttReporter (uint8_t intervalInSeconds=60)
 ksDevStatMqttReporter (uint8_t intervalInSeconds=60)
 Constructs device statistics reporter component.
 
bool postInit (ksApplication *app) override
 Handles component post-initialization.
- Public Member Functions inherited from ksf::ksRtti
template<typename TType >
TType * as ()
 This function is used to cast object to given type.
 Tries to cast object to the type provided as a template parameter.
 
template<typename TType >
const TType * as () const
 This function is used to const cast object to given type.
 Tries to cast object to the type provided as a template parameter (const version).
 
- +

@@ -150,7 +150,7 @@

 
void reportDevStats () const
 Reports device statistics to the broker.
 Reports device statistics to the MQTT broker.
 
- + diff --git a/classksf_1_1comps_1_1ks_device_portal.html b/classksf_1_1comps_1_1ks_device_portal.html index 18f0af0..50ae95b 100644 --- a/classksf_1_1comps_1_1ks_device_portal.html +++ b/classksf_1_1comps_1_1ks_device_portal.html @@ -85,6 +85,11 @@
ksf::comps::ksDevicePortal Class Reference
+ +

A component thet implements web-based configuration portal accessible from local network. + More...

+ +

#include <ksDevicePortal.h>

+ Inheritance diagram for ksf::comps::ksDevicePortal:
@@ -93,46 +98,46 @@
-ksf::ksComponent -ksf::ksRtti +ksf::ksComponent +ksf::ksRtti

@@ -175,7 +175,33 @@

A component that periodocally reports device state to the broker.

Upon instantiated, the component will look for ksMqttConnector component. The interval between each update is defined by the construction parameter.

Each update contain values like RSSI, device uptime, connection time and IP address. The subtopic used is "dstat", so for example RSSI will be sent to the topic named "deviceprefix/dstat/rssi".

-

Member Function Documentation

+

Constructor & Destructor Documentation

+ +

◆ ksDevStatMqttReporter()

+ +
+
+ + + + + + + +
ksf::comps::ksDevStatMqttReporter::ksDevStatMqttReporter (uint8_t intervalInSeconds = 60)
+
+ +

Constructs device statistics reporter component.

+
Parameters
+ + +
intervalInSecondsInterval in seconds between each report.
+
+
+ +
+
+

Member Function Documentation

◆ getInstanceType()

@@ -199,8 +225,8 @@

-

This function is used to get type ID of object.

-
Returns
Type ID.
+

Retrieves type ID of the object.

+
Returns
Object type ID.

Reimplemented from ksf::ksComponent.

@@ -229,10 +255,10 @@

-

This function is used to check if object is of given type.

+

Checks whether object is of given type.

Parameters
- +
idType ID.
idType ID to check against.
@@ -268,7 +294,7 @@

Parameters
- +
appPointer to the parent, which is ksApplication.
appPointer to the parent ksApplication.
@@ -276,6 +302,8 @@

ksf::ksComponent.

+

References reportDevStats(), reporterTimer, and ksf::ksSimpleTimer::triggered().

+ @@ -302,8 +330,11 @@

Calback executed on MQTT connection.

-
This callback is used to restart reporter timer to match
-

the intervals between individual reports. The timer will be processed even if the MQTT is not connected, but reportDevStats will quickly return.

+

This callback is used to restart reporter timer to match the intervals between individual reports. The timer will be processed even if the MQTT is not connected, but reportDevStats will quickly return.

+ +

References reporterTimer, and ksf::ksSimpleTimer::restart().

+ +

Referenced by postInit().

@@ -334,7 +365,7 @@

Parameters
- +
appPointer to the parent, which is ksApplication object.
appPointer to the paren ksApplication.
@@ -342,7 +373,7 @@

ksf::ksComponent.

-

References ksf::ksApplication::findComponent(), ksf::comps::ksMqttConnector::onConnected, and ksf::evt::ksEvent< Params >::registerEvent().

+

References connEventHandle, ksf::ksApplication::findComponent(), mqttConnWp, onConnected(), ksf::comps::ksMqttConnector::onConnected, and ksf::evt::ksEvent< Params >::registerEvent().

diff --git a/classksf_1_1comps_1_1ks_device_portal-members.html b/classksf_1_1comps_1_1ks_device_portal-members.html index bb1beac..2d5530f 100644 --- a/classksf_1_1comps_1_1ks_device_portal-members.html +++ b/classksf_1_1comps_1_1ks_device_portal-members.html @@ -104,7 +104,7 @@

loop(ksApplication *app) overrideksf::comps::ksDevicePortalvirtual
loopExecutionTimeksf::comps::ksDevicePortalprotected
mqttConnectorWpksf::comps::ksDevicePortalprotected
onAppLog(std::string &msgRef)ksf::comps::ksDevicePortalprotected
onAppLog(std::string &&message)ksf::comps::ksDevicePortalprotected
onHandlePortalCommandksf::comps::ksDevicePortal
onRequest_index()ksf::comps::ksDevicePortalprotected
onRequest_notFound() constksf::comps::ksDevicePortalprotected
- + - + - + - + - + - + - + - + - + - +

Public Member Functions

virtual const size_t getInstanceType () const
 This function is used to get type ID of object.
 Retrieves type ID of the object.
 
virtual bool isA (const size_t id) const
 This function is used to check if object is of given type.
 Checks whether object is of given type.
 
 ksDevicePortal ()
 Constructor, used to construct Device Portal component.
 Constructs the Device Portal component.
 
 ksDevicePortal (std::string portalPassword)
 Constructor, used to construct Device Portal component.
 Constructs the Device Portal component with custom password.
 
bool init (ksApplication *app) override
 Initializes device portal component.
 Initializes the device portal component.
 
bool postInit (ksApplication *app) override
 Post initialization method for device portal with integrated OTA.
 Post-initializes the device portal component.
 
bool loop (ksApplication *app) override
 Handles device portal component loop logic.
 Handles core logic of the device portal component.
 
virtual ~ksDevicePortal ()
 Destructor used to cleanup resources.
 Destructs the Device Portal component.
 
- Public Member Functions inherited from ksf::ksRtti
template<typename TType >
TType * as ()
 This function is used to cast object to given type.
 Tries to cast object to the type provided as a template parameter.
 
template<typename TType >
const TType * as () const
 This function is used to const cast object to given type.
 Tries to cast object to the type provided as a template parameter (const version).
 
- + - + - + - + - + - + - - + + - - + + - + - + - + - + - + - + - + - - - + + +

@@ -158,60 +163,58 @@ Protected Member Functions

void requestAppBreak ()
 Causes the app to break from loop with false status.
 Causes the application exit (and ksAppRotator to spawn and process next defined application).
 
void setupHttpServer ()
 This function starts OTA update server.
 Starts device portal HTTP server.
 
void setupWsServer ()
 This function starts WebSocket server.
 Starts device portal WebSocket server.
 
void updateFinished (bool fromPortal)
 This function is called when OTA update is finished.
 Implements post-OTA update actions.
 
void rebootDevice ()
 This function handles device reboot.
 Reboots the device.
 
bool inRequest_NeedAuthentication ()
 This function handles authentication error.
 Checks if current HTTP request requires authentication.
 
-void onRequest_notFound () const
 This function handles "not found" error.
void onRequest_notFound () const
 HTTP handler for 404 "not found" endpoint.
 
-void onRequest_index ()
 This function serves main page to the client.
void onRequest_index ()
 HTTP handler for index endpoint.
 
void onRequest_otaChunk ()
 This function is called for each OTA chunk.
 HTTP handler for OTA chunk endpoint.
 
void onRequest_otaFinish ()
 This function is called when OTA update is finished.
 HTTP handler for OTA finish endpoint.
 
void onWebsocketTextMessage (uint8_t clientNum, const std::string_view &message)
 This function handles incomming websocket messages.
 Handles websocket text message.
 
void handle_scanNetworks (std::string &response)
 This function handles scanning networks.
 Websocket handler for network scan endpoint.
 
void handle_getIdentity (std::string &response)
 This function handles identity request.
 Websocket handler for identity endpoint (device details).
 
void handle_getDeviceParams (std::string &response)
 This function handles device params request.
 Websocket handler for device parameters endpoint.
 
std::string handle_executeCommand (const std::string_view &body)
 This function handles command execution.
 Websocket handler for user commands endpoint.
 
void onAppLog (std::string &msgRef)
 This function handles logging.
 
void onAppLog (std::string &&message)
 Broadcasts application log message to all connected Websocket clients.
 
@@ -267,7 +270,11 @@

Protected Attributes

ksComponentState::TYPE componentState { ksComponentState::NotInitialized }
 
-

Constructor & Destructor Documentation

+

Detailed Description

+

A component thet implements web-based configuration portal accessible from local network.

+

The portal can be used to upload OTA update, both in access point and station mode. There's also web-based terminal which can be used to debug the device and examine realitme application logs.

+

In case of confiugrator application, please don't add this component directly and use ksWifiConfigurator instead. In case of "normal application", you have to add the component manually if you want to use it.

+

Constructor & Destructor Documentation

◆ ksDevicePortal() [1/2]

@@ -283,7 +290,7 @@

-

Constructor, used to construct Device Portal component.

+

Constructs the Device Portal component.

Uses the default password "ota_ksiotframework"

@@ -303,7 +310,7 @@

-

Constructor, used to construct Device Portal component.

+

Constructs the Device Portal component with custom password.

Parameters
@@ -339,8 +346,8 @@

-

This function is used to get type ID of object.

-
Returns
Type ID.
+

Retrieves type ID of the object.

+
Returns
Object type ID.

Reimplemented from ksf::ksComponent.

@@ -369,14 +376,14 @@

-

This function handles command execution.

+

Websocket handler for user commands endpoint.

Parameters

passwordPassword used to authenticate the user.
- +
bodyCommand body
bodyCommand string from the browser.
-
Returns
Command response.
+
Returns
String with commadn execution result.

References ksf::evt::ksEvent< Params >::broadcast(), onHandlePortalCommand, and rebootDevice().

@@ -407,10 +414,10 @@

-

This function handles device params request.

+

Websocket handler for device parameters endpoint.

Parameters
- +
responseResponse reference, where the response should be appended
responseResponse reference . This method will output device configuration parameters into this string.
@@ -444,10 +451,10 @@

-

This function handles identity request.

+

Websocket handler for identity endpoint (device details).

Parameters
- +
responseResponse reference, where the response should be appended
responseResponse reference. This method will output device details in JSON format into this string.
@@ -481,10 +488,10 @@

-

This function handles scanning networks.

+

Websocket handler for network scan endpoint.

Parameters
- +
responseResponse reference, where the response should be appended
responseResponse reference. This method will output network scan results in JSON format into this string.
@@ -518,14 +525,14 @@

-

Initializes device portal component.

+

Initializes the device portal component.

Parameters
- +
appPointer to ksApplication
appPointer to the parent ksApplication.
-
Returns
True on success, false on fail.
+
Returns
True on success, false otherwise.

Reimplemented from ksf::ksComponent.

@@ -556,10 +563,10 @@

-

This function is used to check if object is of given type.

+

Checks whether object is of given type.

Parameters
- +
idType ID.
idType ID to check against.
@@ -592,14 +599,14 @@

-

Handles device portal component loop logic.

+

Handles core logic of the device portal component.

Parameters
- +
appPointer to ksApplication.
appPointer to the parent ksApplication.
-
Returns
True on success, false on fail.
+
Returns
True on success, false otherwise.

Reimplemented from ksf::ksComponent.

@@ -607,8 +614,8 @@

-

◆ onAppLog()

+ +

◆ onAppLog()

+ +

◆ onRequest_index()

+ +
+
+ + + + + +
+ + + + + + + +
void ksf::comps::ksDevicePortal::onRequest_index ()
+
+protected
+
+ +

HTTP handler for index endpoint.

+

Called when the browser requests "/" endpoint. This is the default endpoint.

+ +

References inRequest_NeedAuthentication(), webServer, and webSocket.

+ +

Referenced by setupHttpServer().

+ +
+
+ +

◆ onRequest_notFound()

+ +
+
+ + + + + +
+ + + + + + + +
void ksf::comps::ksDevicePortal::onRequest_notFound () const
+
+protected
+
+ +

HTTP handler for 404 "not found" endpoint.

+

Called when the browser requests an endpoint that doesn't exist.

+ +

References webServer.

+ +

Referenced by setupHttpServer().

+
@@ -667,8 +738,8 @@

-

This function is called for each OTA chunk.

-

Handles endpoint "/api/flash".

+

HTTP handler for OTA chunk endpoint.

+

Called when the browser requests "/api/flash" endpoint with next firmware upload part. Used also to notify the browser about firmware uplaod progress.

References ksf::evt::ksEvent< Params >::broadcast(), inRequest_NeedAuthentication(), onUpdateStart, and webServer.

@@ -699,8 +770,8 @@

-

This function is called when OTA update is finished.

-

Handles endpoint "/api/flash".

+

HTTP handler for OTA finish endpoint.

+

Called when the browser requests "/api/flash" endpoint and the upload is complete. Used also to tell the browser that the upload is complete (or failed).

References inRequest_NeedAuthentication(), rebootDevice(), updateFinished(), and webServer.

@@ -735,16 +806,16 @@

-

This function handles incomming websocket messages.

+

Handles websocket text message.

Parameters
- - + +
clientNumClient number
messageMessage string view
clientNumNumber of Websocket client (used as ID to know who's the sender).
messageString view of the message content.
-

References app, ksf::ksApplication::findComponents(), handle_executeCommand(), handle_getDeviceParams(), handle_getIdentity(), handle_scanNetworks(), logKeepAliveTimestamp, onAppLog(), requestAppBreak(), and webSocket.

+

References app, ksf::ksApplication::findComponents(), handle_executeCommand(), handle_getDeviceParams(), handle_getIdentity(), handle_scanNetworks(), logKeepAliveTimestamp, onAppLog(), requestAppBreak(), and webSocket.

Referenced by setupWsServer().

@@ -773,14 +844,14 @@

-

Post initialization method for device portal with integrated OTA.

+

Post-initializes the device portal component.

Parameters
- +
appPointer to ksApplication
appPointer to the parent ksApplication.
-
Returns
True on success, false on fail.
+
Returns
True on success, false otherwise.

Reimplemented from ksf::ksComponent.

@@ -800,7 +871,14 @@

-

Evnet for portal console commands.

+

Custom command handler event.

Parameters
+ + + + +
param_1String view of the command coming from the browser.
param_2Reference of boolean value indicating if the command was handled. Set to true to stop further processing and return response.
param_3Reference of the string containing the command response. Append results here.
+
+

Referenced by handle_executeCommand().

@@ -817,7 +895,7 @@

-

Update end (OTA) event.

+

Update end (OTA) event. No parameters.

Referenced by updateFinished().

@@ -834,7 +912,7 @@

-

Update start (OTA) event.

+

Update start (OTA) event. No parameters.

Referenced by ksDevicePortal(), and onRequest_otaChunk().

diff --git a/classksf_1_1comps_1_1ks_led.html b/classksf_1_1comps_1_1ks_led.html index af76c08..71ebf9b 100644 --- a/classksf_1_1comps_1_1ks_led.html +++ b/classksf_1_1comps_1_1ks_led.html @@ -96,18 +96,18 @@
-ksf::ksComponent -ksf::ksRtti +ksf::ksComponent +ksf::ksRtti
- + - + @@ -142,16 +142,16 @@ - + - + - +

Public Member Functions

virtual const size_t getInstanceType () const
 This function is used to get type ID of object.
 Retrieves type ID of the object.
 
virtual bool isA (const size_t id) const
 This function is used to check if object is of given type.
 Checks whether object is of given type.
 
 ksLed (uint8_t pin, bool activeLow=false, bool driveAsPushPull=false)
 Constructs the LED object.
 
- Public Member Functions inherited from ksf::ksComponent
virtual bool postInit (ksApplication *app)
 Method called after component initialization.
 Method called after component initialization, used to setup references to other components.
 
- Public Member Functions inherited from ksf::ksRtti
template<typename TType >
TType * as ()
 This function is used to cast object to given type.
 Tries to cast object to the type provided as a template parameter.
 
template<typename TType >
const TType * as () const
 This function is used to const cast object to given type.
 Tries to cast object to the type provided as a template parameter (const version).
 
- + @@ -105,7 +105,7 @@ - + diff --git a/classksf_1_1comps_1_1ks_mqtt_connector.html b/classksf_1_1comps_1_1ks_mqtt_connector.html index c229aad..394244a 100644 --- a/classksf_1_1comps_1_1ks_mqtt_connector.html +++ b/classksf_1_1comps_1_1ks_mqtt_connector.html @@ -99,8 +99,8 @@
-ksf::ksComponent -ksf::ksRtti +ksf::ksComponent +ksf::ksRtti

@@ -258,8 +258,8 @@

-

This function is used to get type ID of object.

-
Returns
Type ID.
+

Retrieves type ID of the object.

+
Returns
Object type ID.

Reimplemented from ksf::ksComponent.

@@ -321,7 +321,7 @@

Parameters
- +
ownerPointer to parent ksApplication object.
ownerPointer to parent ksApplication object.
@@ -356,10 +356,10 @@

-

This function is used to check if object is of given type.

+

Checks whether object is of given type.

Parameters
- +
idType ID.
idType ID to check against.
@@ -533,7 +533,7 @@

References driveAsActiveLow, driveAsPushPull, and pin.

-

Referenced by init(), loop(), ksf::comps::ksWifiConfigurator::postInit(), setBlinking(), setDriveAsPushPull(), and ~ksLed().

+

Referenced by init(), loop(), ksf::comps::ksWifiConfigurator::postInit(), setBlinking(), setDriveAsPushPull(), and ~ksLed().

diff --git a/classksf_1_1comps_1_1ks_mqtt_config_provider.html b/classksf_1_1comps_1_1ks_mqtt_config_provider.html index ec88721..7822552 100644 --- a/classksf_1_1comps_1_1ks_mqtt_config_provider.html +++ b/classksf_1_1comps_1_1ks_mqtt_config_provider.html @@ -96,18 +96,18 @@ ksf::comps::ksConfigProvider -ksf::ksComponent -ksf::ksRtti +ksf::ksComponent +ksf::ksRtti - + - + @@ -128,19 +128,19 @@ - + - + - + - +

Public Member Functions

virtual const size_t getInstanceType () const
 This function is used to get type ID of object.
 Retrieves type ID of the object.
 
virtual bool isA (const size_t id) const
 This function is used to check if object is of given type.
 Checks whether object is of given type.
 
void readParams () override
 Retrieves MQTT parameters.
 Initializes component.
 
virtual bool loop (ksApplication *app)
 Called from application loop.
 Handles component loop logic, called from application loop.
 
virtual bool postInit (ksApplication *app)
 Method called after component initialization.
 Method called after component initialization, used to setup references to other components.
 
- Public Member Functions inherited from ksf::ksRtti
template<typename TType >
TType * as ()
 This function is used to cast object to given type.
 Tries to cast object to the type provided as a template parameter.
 
template<typename TType >
const TType * as () const
 This function is used to const cast object to given type.
 Tries to cast object to the type provided as a template parameter (const version).
 
- + - + @@ -201,8 +201,8 @@

-

This function is used to get type ID of object.

-
Returns
Type ID.
+

Retrieves type ID of the object.

+
Returns
Object type ID.

Reimplemented from ksf::comps::ksConfigProvider.

@@ -231,10 +231,10 @@

-

This function is used to check if object is of given type.

+

Checks whether object is of given type.

Parameters

@@ -160,10 +160,10 @@

Additional Inherited Members

- Protected Member Functions inherited from ksf::comps::ksConfigProvider
void addNewParam (std::string id, std::string value, int maxLength=50, EConfigParamType::Type type={})
void addNewParam (std::string id, std::string value, int maxLength=50, EConfigParamType::Type type={})
 Defines new configutation parameter.
 
void addNewParamWithConfigDefault (ksConfig &config, std::string id, int maxLength=50, EConfigParamType::Type type={})
void addNewParamWithConfigDefault (ksConfig &config, std::string id, int maxLength=50, EConfigParamType::Type type={})
 Defines new configuation parameter (with default value).
 
- Protected Attributes inherited from ksf::comps::ksConfigProvider
- +
idType ID.
idType ID to check against.
@@ -301,8 +301,8 @@

Saves MQTT aprameters into the configuration file.

-
This method saves current (in-memory) MQTT properties into the configuration file.
-
+

This method saves current (in-memory) MQTT properties into the configuration file.

+

Implements ksf::comps::ksConfigProvider.

@@ -332,7 +332,7 @@

References ksf::comps::ksMqttConnector::setupConnection().

-

Referenced by ksf::comps::ksMqttConnector::init().

+

Referenced by ksf::comps::ksMqttConnector::init().

diff --git a/classksf_1_1comps_1_1ks_mqtt_connector-members.html b/classksf_1_1comps_1_1ks_mqtt_connector-members.html index 959926f..c74882f 100644 --- a/classksf_1_1comps_1_1ks_mqtt_connector-members.html +++ b/classksf_1_1comps_1_1ks_mqtt_connector-members.html @@ -90,7 +90,7 @@

getConnectionTimeSeconds() constksf::comps::ksMqttConnector
getInstanceType() constksf::comps::ksMqttConnectorinlinevirtual
getReconnectCounter() constksf::comps::ksMqttConnectorinline
init(ksApplication *owner) overrideksf::comps::ksMqttConnectorvirtual
init(ksApplication *app) overrideksf::comps::ksMqttConnectorvirtual
isA(const size_t id) constksf::comps::ksMqttConnectorinlinevirtual
isConnected() constksf::comps::ksMqttConnector
ksMqttConnector(bool sendConnectionStatus=true, bool usePersistentSession=false)ksf::comps::ksMqttConnector
onDeviceMessageksf::comps::ksMqttConnector
onDisconnectedksf::comps::ksMqttConnector
passwordksf::comps::ksMqttConnectorprotected
postInit(ksApplication *owner) overrideksf::comps::ksMqttConnectorvirtual
postInit(ksApplication *app) overrideksf::comps::ksMqttConnectorvirtual
prefixksf::comps::ksMqttConnectorprotected
publish(const std::string &topic, const std::string &payload, bool retain=false, bool skipDevicePrefix=false)ksf::comps::ksMqttConnector
QosLevel enum name (defined in ksf::comps::ksMqttConnector)ksf::comps::ksMqttConnector
@@ -114,20 +114,20 @@ - + - + - - - - - - + + + + + + @@ -159,11 +159,11 @@ - + - +

Public Member Functions

virtual const size_t getInstanceType () const
 This function is used to get type ID of object.
 Retrieves type ID of the object.
 
virtual bool isA (const size_t id) const
 This function is used to check if object is of given type.
 Checks whether object is of given type.
 
 ksMqttConnector (bool sendConnectionStatus=true, bool usePersistentSession=false)
 Constructs ksMqttConnector object.
 
bool init (ksApplication *owner) override
 Instantiates the MQTT connector component.
 
bool postInit (ksApplication *owner) override
 Method that handles component post-initialization.
 
bool init (ksApplication *app) override
 Instantiates the MQTT connector component.
 
bool postInit (ksApplication *app) override
 Method that handles component post-initialization.
 
bool loop (ksApplication *app) override
 Executes MQTT connection logic.
 
- Public Member Functions inherited from ksf::ksRtti
template<typename TType >
TType * as ()
 This function is used to cast object to given type.
 Tries to cast object to the type provided as a template parameter.
 
template<typename TType >
const TType * as () const
 This function is used to const cast object to given type.
 Tries to cast object to the type provided as a template parameter (const version).
 
- +

@@ -378,8 +378,8 @@

-

This function is used to get type ID of object.

-
Returns
Type ID.
+

Retrieves type ID of the object.

+
Returns
Object type ID.

Reimplemented from ksf::ksComponent.

@@ -415,8 +415,8 @@

-

◆ init()

+ +

◆ init()

(ksApplication * owner)ksApplication * app)
@@ -441,7 +441,7 @@

Parameters
- +
ownerPointer to the ksApplication object (parent).
appPointer to the parent ksApplication.
@@ -476,10 +476,10 @@

-

This function is used to check if object is of given type.

+

Checks whether object is of given type.

Parameters
- +
idType ID.
idType ID to check against.
@@ -625,8 +625,8 @@

-

◆ postInit()

+ +

◆ postInit()

- + - + @@ -127,16 +127,16 @@ - + - + - +

Public Member Functions

virtual const size_t getInstanceType () const
 This function is used to get type ID of object.
 Retrieves type ID of the object.
 
virtual bool isA (const size_t id) const
 This function is used to check if object is of given type.
 Checks whether object is of given type.
 
 ksResetButton (uint8_t pin, uint8_t triggerState, uint8_t mode=INPUT)
 Constructs the reset button component.
 
- Public Member Functions inherited from ksf::ksComponent
virtual bool postInit (ksApplication *app)
 Method called after component initialization.
 Method called after component initialization, used to setup references to other components.
 
- Public Member Functions inherited from ksf::ksRtti
template<typename TType >
TType * as ()
 This function is used to cast object to given type.
 Tries to cast object to the type provided as a template parameter.
 
template<typename TType >
const TType * as () const
 This function is used to const cast object to given type.
 Tries to cast object to the type provided as a template parameter (const version).
 

@@ -181,7 +181,7 @@

Detailed Description

A component that implements reset button functionality.

-

On short press, it will cause component loop to return false, then ksAppRotator will move to the next application. On long press, it will erase user data (factory reset).

+

On short press, it will cause component loop to return false, then ksAppRotator will move to the next application. On long press, it will erase user data (factory reset).

The component has also built-in debounce handling logic.

Constructor & Destructor Documentation

@@ -244,8 +244,8 @@

-

This function is used to get type ID of object.

-
Returns
Type ID.
+

Retrieves type ID of the object.

+
Returns
Object type ID.

Reimplemented from ksf::ksComponent.

@@ -307,7 +307,7 @@

Parameters
- +
appPointer to the parent ksApplication.
appPointer to the parent ksApplication.
@@ -342,10 +342,10 @@

-

This function is used to check if object is of given type.

+

Checks whether object is of given type.

Parameters
- +
idType ID.
idType ID to check against.
@@ -381,7 +381,7 @@

Parameters
- +
appPointer to the parent ksApplication.
appPointer to the parent ksApplication.
diff --git a/classksf_1_1comps_1_1ks_wifi_configurator-members.html b/classksf_1_1comps_1_1ks_wifi_configurator-members.html index 39bef19..7e96ecc 100644 --- a/classksf_1_1comps_1_1ks_wifi_configurator-members.html +++ b/classksf_1_1comps_1_1ks_wifi_configurator-members.html @@ -81,22 +81,22 @@

This is the complete list of members for ksf::comps::ksWifiConfigurator, including all inherited members.

- - - - - - - - - - - - - - + + + + + + + + + + + + + + - +
as()ksf::ksRttiinline
as() constksf::ksRttiinline
componentStateksf::ksComponentprotected
configTimeoutksf::comps::ksWifiConfiguratorprotected
deviceNameksf::comps::ksWifiConfiguratorprotected
getClassType() (defined in ksf::comps::ksWifiConfigurator)ksf::comps::ksWifiConfiguratorinlinestatic
getInstanceType() constksf::comps::ksWifiConfiguratorinlinevirtual
handlePeriodicTasks()ksf::comps::ksWifiConfiguratorprotected
init(ksApplication *owner) overrideksf::comps::ksWifiConfiguratorvirtual
isA(const size_t id) constksf::comps::ksWifiConfiguratorinlinevirtual
ksWifiConfigurator()ksf::comps::ksWifiConfigurator
ksWifiConfigurator(std::string devicePrefixName)ksf::comps::ksWifiConfigurator
loop(ksApplication *app) overrideksf::comps::ksWifiConfiguratorvirtual
ownerksf::comps::ksWifiConfiguratorprotected
appksf::comps::ksWifiConfiguratorprotected
as()ksf::ksRttiinline
as() constksf::ksRttiinline
componentStateksf::ksComponentprotected
configTimeoutksf::comps::ksWifiConfiguratorprotected
deviceNameksf::comps::ksWifiConfiguratorprotected
getClassType() (defined in ksf::comps::ksWifiConfigurator)ksf::comps::ksWifiConfiguratorinlinestatic
getInstanceType() constksf::comps::ksWifiConfiguratorinlinevirtual
handlePeriodicTasks()ksf::comps::ksWifiConfiguratorprotected
init(ksApplication *app) overrideksf::comps::ksWifiConfiguratorvirtual
isA(const size_t id) constksf::comps::ksWifiConfiguratorinlinevirtual
ksWifiConfigurator()ksf::comps::ksWifiConfigurator
ksWifiConfigurator(std::string devicePrefixName)ksf::comps::ksWifiConfigurator
loop(ksApplication *app) overrideksf::comps::ksWifiConfiguratorvirtual
periodicTasksTimeoutksf::comps::ksWifiConfiguratorprotected
postInit(ksApplication *owner) overrideksf::comps::ksWifiConfiguratorvirtual
postInit(ksApplication *app) overrideksf::comps::ksWifiConfiguratorvirtual
~ksWifiConfigurator()ksf::comps::ksWifiConfiguratorvirtual

diff --git a/classksf_1_1comps_1_1ks_wifi_configurator.html b/classksf_1_1comps_1_1ks_wifi_configurator.html index d8e4515..f59e369 100644 --- a/classksf_1_1comps_1_1ks_wifi_configurator.html +++ b/classksf_1_1comps_1_1ks_wifi_configurator.html @@ -84,6 +84,11 @@
ksf::comps::ksWifiConfigurator Class Reference
+ +

ksWifiConfigurator component class. + More...

+ +

#include <ksWifiConfigurator.h>

+ Inheritance diagram for ksf::comps::ksWifiConfigurator:
@@ -92,18 +97,18 @@
-ksf::ksComponent -ksf::ksRtti +ksf::ksComponent +ksf::ksRtti
- + - + @@ -112,27 +117,27 @@ - - + + - - - - - - + + + + + + - + - + - +

Public Member Functions

virtual const size_t getInstanceType () const
 This function is used to get type ID of object.
 Retrieves type ID of the object.
 
virtual bool isA (const size_t id) const
 This function is used to check if object is of given type.
 Checks whether object is of given type.
 
 ksWifiConfigurator ()
 ksWifiConfigurator (std::string devicePrefixName)
 Constructs WiFi configurator object.
 
bool loop (ksApplication *app) override
 Handles ksWifiConfigurator logic.
bool loop (ksApplication *app) override
 Handles ksWifiConfigurator logic.
 
bool init (ksApplication *owner) override
 ksWifiConfigurator init function.
 
bool postInit (ksApplication *owner) override
 ksWifiConfigurator postInit function.
 
bool init (ksApplication *app) override
 Implements ksWifiConfigurator initialization logic.
 
bool postInit (ksApplication *app) override
 Implements ksWifiConfigurator post-initialization logic.
 
virtual ~ksWifiConfigurator ()
 Destructor for WiFi configurator component.
 Destructs WiFi configurator component.
 
- Public Member Functions inherited from ksf::ksRtti
template<typename TType >
TType * as ()
 This function is used to cast object to given type.
 Tries to cast object to the type provided as a template parameter.
 
template<typename TType >
const TType * as () const
 This function is used to const cast object to given type.
 Tries to cast object to the type provided as a template parameter (const version).
 

@@ -154,10 +159,10 @@

- - - + + + @@ -174,7 +179,10 @@

Protected Attributes

-ksApplicationowner {nullptr}
 Pointer to ksApplication object that owns this component.
 
+ksApplicationapp {nullptr}
 Pointer to ksApplication object that owns this component.
 
std::string deviceName
 Device name (prefix).
ksComponentState::TYPE componentState { ksComponentState::NotInitialized }
 
-

Constructor & Destructor Documentation

+

Detailed Description

+

ksWifiConfigurator component class.

+

Handles Device Portal, where the user can configure the device like WiFi or MQTT credentials as well as custom, application-defined parameters implemented using ksConfigProvider interface.

+

Constructor & Destructor Documentation

◆ ksWifiConfigurator()

@@ -226,15 +234,15 @@

-

This function is used to get type ID of object.

-
Returns
Type ID.
+

Retrieves type ID of the object.

+
Returns
Object type ID.

Reimplemented from ksf::ksComponent.

- -

◆ init()

+ +

◆ init()

@@ -245,7 +253,7 @@

bool ksf::comps::ksWifiConfigurator::init ( - ksApplication * owner) + ksApplication * app) @@ -256,10 +264,10 @@

-

ksWifiConfigurator init function.

+

Implements ksWifiConfigurator initialization logic.

Parameters
- +
ownerPointer to the application object
appPointer to ksApplication object that owns this component
@@ -267,7 +275,7 @@

ksf::ksComponent.

-

References ksf::ksApplication::addComponent(), and deviceName.

+

References ksf::ksApplication::addComponent(), app, and deviceName.

@@ -294,10 +302,10 @@

-

This function is used to check if object is of given type.

+

Checks whether object is of given type.

Parameters
- +
idType ID.
idType ID to check against.
@@ -330,8 +338,14 @@

-

Handles ksWifiConfigurator logic.

+

Handles ksWifiConfigurator logic.

It starts and handles Device Portal, where the user can configure the device (that means WiFi or MQTT credential as well as custom defined device parameters).

+
Parameters
+ + +
appPointer to ksApplication object that owns this component.
+
+
Returns
True if loop succedeed, otherwise false.

Reimplemented from ksf::ksComponent.

@@ -340,8 +354,8 @@

-

◆ postInit()

+ +

◆ postInit()

@@ -352,7 +366,7 @@

bool ksf::comps::ksWifiConfigurator::postInit ( - ksApplication * owner) + ksApplication * app) @@ -363,11 +377,10 @@

-

ksWifiConfigurator postInit function.

-

Turns on all registered LEDs in config mode.

+

Implements ksWifiConfigurator post-initialization logic.

Parameters
- +
ownerPointer to ksApplication object that owns this component
appPointer to ksApplication object that owns this component
@@ -375,7 +388,7 @@

ksf::ksComponent.

-

References ksf::ksApplication::findComponents(), and ksf::comps::ksLed::setEnabled().

+

References app, ksf::ksApplication::findComponents(), and ksf::comps::ksLed::setEnabled().

diff --git a/classksf_1_1comps_1_1ks_wifi_connector.html b/classksf_1_1comps_1_1ks_wifi_connector.html index 015fe52..be5a2ca 100644 --- a/classksf_1_1comps_1_1ks_wifi_connector.html +++ b/classksf_1_1comps_1_1ks_wifi_connector.html @@ -85,6 +85,11 @@
ksf::comps::ksWifiConnector Class Reference
+ +

A component that manages WiFi connection. + More...

+ +

#include <ksWifiConnector.h>

+ Inheritance diagram for ksf::comps::ksWifiConnector:
@@ -93,21 +98,21 @@
-ksf::ksComponent -ksf::ksRtti +ksf::ksComponent +ksf::ksRtti
- + - + - + @@ -120,20 +125,20 @@ - + - + - + - +

Public Member Functions

virtual const size_t getInstanceType () const
 This function is used to get type ID of object.
 Retrieves type ID of the object.
 
virtual bool isA (const size_t id) const
 This function is used to check if object is of given type.
 Checks whether object is of given type.
 
 ksWifiConnector (const char *hostname, bool savePower=true)
 Constructor for WiFi connector component.
 Constructs WiFi connector component.
 
bool init (ksApplication *app) override
 Initializes WiFi connector component.
 
virtual ~ksWifiConnector ()
 Destructor for WiFi connector component.
 Destructos WiFi connector component.
 
- Public Member Functions inherited from ksf::ksComponent
virtual bool postInit (ksApplication *app)
 Method called after component initialization.
 Method called after component initialization, used to setup references to other components.
 
- Public Member Functions inherited from ksf::ksRtti
template<typename TType >
TType * as ()
 This function is used to cast object to given type.
 Tries to cast object to the type provided as a template parameter.
 
template<typename TType >
const TType * as () const
 This function is used to const cast object to given type.
 Tries to cast object to the type provided as a template parameter (const version).
 
- + @@ -173,15 +178,15 @@ Protected Attributes - + - + - + @@ -199,7 +204,16 @@

@@ -158,7 +163,7 @@

Protected Member Functions

void setupMacAddress ()
 Internal method to setup MAC address.
 Internal method that generates MAC address for the device.
 
void wifiConnectedInternal ()
ksSimpleTimer wifiTimeoutTimer { 120000UL }
 Wifi timer - timeout.
 Wifi timer - long timeout in case of issues.
 
ksSimpleTimer wifiReconnectTimer { 5000UL }
 Wifi timer - reconnect.
 Wifi timer - reconnection timeout.
 
ksSimpleTimer wifiIpCheckTimer { 1000UL }
 Wifi timer - IP check.
 Wifi timer - IP check interval.
 
bool wasConnected: 1 {false}
ksComponentState::TYPE componentState { ksComponentState::NotInitialized }
 
-

Constructor & Destructor Documentation

+

Detailed Description

+

A component that manages WiFi connection.

+

This component handles WiFi connection, reconnecting automatically in case of disconnection.

+

There are many things that this component manages:

    +
  • MAC address generation (to easily identify ksIotFrameworkLib based devices)
  • +
  • Simple power management (DTIM low-power mode)
  • +
  • IP address validation, used to determine if WiFi connection was successful (not only using WiFi PHY state)
  • +
  • Timeout management, used to break in case of longer WiFi connection issues (causing application to exit and swittch to configuration mode)
  • +
+

Constructor & Destructor Documentation

◆ ksWifiConnector()

@@ -219,11 +233,11 @@

-

Constructor for WiFi connector component.

+

Constructs WiFi connector component.

Parameters
- - + +
hostnameHostname to be used by WiFi class
savePowerTrue to save power
hostnameHostname of the device, used also by mDNS service.
savePowerIf set, will put the device in modem sleep mode. This is useful to reduce power consumption, but increases reaction time.
@@ -256,8 +270,8 @@

-

This function is used to get type ID of object.

-
Returns
Type ID.
+

Retrieves type ID of the object.

+
Returns
Object type ID.

Reimplemented from ksf::ksComponent.

@@ -289,7 +303,7 @@

Parameters
- +
ownerPointer to ksApplication object that owns this component
appPointer to the parent ksApplication.
@@ -324,10 +338,10 @@

-

This function is used to check if object is of given type.

+

Checks whether object is of given type.

Parameters
- +
idType ID.
idType ID to check against.
@@ -385,6 +399,12 @@

Handles WiFi connector component loop logic.

+
Parameters
+ + +
appPointer to the parent ksApplication.
+
+
Returns
True on success, false on fail.

Reimplemented from ksf::ksComponent.

@@ -416,7 +436,7 @@

-

Internal method to setup MAC address.

+

Internal method that generates MAC address for the device.

This MAC is generated by using original ChipID / MAC, but starts with 0xFA 0xF1 and then there are four Chip ID bytes. 0xFA 0xF1 works like prefix / signature to help identyfying devices in router properties / Wireshark (debugging) etc.

Referenced by ksWifiConnector().

diff --git a/classksf_1_1ks_app_rotator.html b/classksf_1_1ks_app_rotator.html index a721cc0..a113b63 100644 --- a/classksf_1_1ks_app_rotator.html +++ b/classksf_1_1ks_app_rotator.html @@ -81,6 +81,11 @@
ksf::ksAppRotator< AppTypes > Class Template Reference

+ +

Application rotator component. + More...

+ +

#include <ksAppRotator.h>

@@ -89,10 +94,19 @@ - +

Public Member Functions

 Runs the application loop.
 
void loop (unsigned long milliseconds)
 Runs the application loop with a delay.
 Runs application loop with a delay between loops.
 
-

Member Function Documentation

+

Detailed Description

+
template<class... AppTypes>
+class ksf::ksAppRotator< AppTypes >

Application rotator component.

+
Template Parameters
+ + +
...List of application classes to be used.
+
+
+

Member Function Documentation

◆ loop()

@@ -118,7 +132,7 @@

-

Runs the application loop with a delay.

+

Runs application loop with a delay between loops.

Parameters
diff --git a/classksf_1_1ks_application.html b/classksf_1_1ks_application.html index cb9f08e..3f76948 100644 --- a/classksf_1_1ks_application.html +++ b/classksf_1_1ks_application.html @@ -82,26 +82,31 @@
ksf::ksApplication Class Referenceabstract
+ +

A class that is a base for user-defined application. + More...

+ +

#include <ksApplication.h>

millisecondsDelay time in milliseconds.
- + - + - + - +

Public Member Functions

template<class TComponentType , class... TParams>
std::weak_ptr< TComponentType > addComponent (TParams... arg)
 Instantiates a component of passed type.
 Instantiates a component of the type defined by the template instance. This function will pass all template-defined parameters to the component constructor.
 
template<class TComponentType >
void findComponents (std::vector< std::weak_ptr< TComponentType > > &outComponents)
 Looks for all components of passed type and puts them into passed vector.
 Iterates through all components and returns a vector of weak pointers with components that matches the type passed as a template parameter.
 
template<class TComponentType >
std::weak_ptr< TComponentType > findComponent ()
 Looks for a component of passed type and returns a weak pointer to it.
 Iterates through all components and returns a weak pointer to the first component that matches the type passed as a template parameter.
 
virtual bool init ()=0
 Initializes application.
 
virtual bool loop ()
 Executes application loop.
 Executes application logic loop.
 

@@ -111,7 +116,13 @@

 An array with shared_ptr of components (holding main reference).
 
-

Member Function Documentation

+

Detailed Description

+

A class that is a base for user-defined application.

+

ksApplication implements core application logic. It is responsible for initializing and running components.

+

You must override init method to build component stack. You can return false to stop the initialization. In this case, application will be stopped and ksAppRotator will move to the next application.

+

Do not override loop method until you have a good reason. If you do so, keep in mind that you should call base loop method and return the result properly. If any component returns false, application logic should be stopped. The best way is to add only small piece of code and return the reult of the base loop method. It is also safe to return false early, before calling base loop method.

+

When init or loop returns false, application will be stopped.

+

Member Function Documentation

◆ addComponent()

@@ -137,19 +148,25 @@

-

Instantiates a component of passed type.

-

This function will pass all template-defined parameters as constructor parameters to the component. Keep in mind that passed parameters must match target component constructor parameters.

+

Instantiates a component of the type defined by the template instance. This function will pass all template-defined parameters to the component constructor.

+
Template Parameters
+ + + +
TComponentTypeA type of the component.
TParams...A list of parameters to be passed to the component constructor.
+
+
Parameters
- +
...- user (template) defined parameters
arg...A list of parameters to be passed to the component constructor.
-
Returns
Weak pointer to the newly created component.
+
Returns
Weak pointer to the created component.

References components, and ksf::ksComponent::getInstanceType().

-

Referenced by ksf::comps::ksWifiConfigurator::init().

+

Referenced by ksf::comps::ksWifiConfigurator::init().

@@ -178,12 +195,18 @@

-

Looks for a component of passed type and returns a weak pointer to it.

-
Returns
Weak pointer to the component of passed type.
+

Iterates through all components and returns a weak pointer to the first component that matches the type passed as a template parameter.

+
Template Parameters
+ + +
TComponentTypeA type of the component to look for.
+
+
+
Returns
Weak pointer to the first component that matches the type passed as a template parameter.

References components, and ksf::ksComponent::getInstanceType().

-

Referenced by ksf::comps::ksDevicePortal::postInit(), ksf::comps::ksDevStatMqttReporter::postInit(), and ksf::comps::ksMqttConnector::postInit().

+

Referenced by ksf::comps::ksDevicePortal::postInit(), ksf::comps::ksDevStatMqttReporter::postInit(), and ksf::comps::ksMqttConnector::postInit().

@@ -212,17 +235,23 @@

-

Looks for all components of passed type and puts them into passed vector.

+

Iterates through all components and returns a vector of weak pointers with components that matches the type passed as a template parameter.

+
Template Parameters
+ + +
TComponentTypeA type of the component to look for.
+
+
Parameters
- +
outComponentsVector of weak pointers to components of passed type.
outComponentsA vector of weak pointers to components that match the type passed as a template parameter.

References components, and ksf::ksComponent::getInstanceType().

-

Referenced by ksf::comps::ksDevicePortal::handle_getDeviceParams(), ksf::comps::ksDevicePortal::onWebsocketTextMessage(), and ksf::comps::ksWifiConfigurator::postInit().

+

Referenced by ksf::comps::ksDevicePortal::handle_getDeviceParams(), ksf::comps::ksDevicePortal::onWebsocketTextMessage(), and ksf::comps::ksWifiConfigurator::postInit().

@@ -250,7 +279,7 @@

Initializes application.

-
Returns
True on success, false on fail (will break application execution).
+
Returns
True on success, false otherwise (will break application execution).
@@ -277,8 +306,8 @@

-

Executes application loop.

-
Returns
True on success, false on fail (will break application execution).
+

Executes application logic loop.

+
Returns
True on success, false otherwise (will break application execution).

References components.

diff --git a/classksf_1_1ks_cert_fingerprint.html b/classksf_1_1ks_cert_fingerprint.html index 7d80ad1..af3805a 100644 --- a/classksf_1_1ks_cert_fingerprint.html +++ b/classksf_1_1ks_cert_fingerprint.html @@ -82,6 +82,11 @@
ksf::ksCertFingerprint Class Reference
+ +

Interface for certificate fingerprint verification. + More...

+ +

#include <ksCertUtils.h>

@@ -98,7 +103,10 @@

Public Member Functions

 Converts fingerprint string into array of bytes.
 
-

Member Function Documentation

+

Detailed Description

+

Interface for certificate fingerprint verification.

+

Implements platform-dependent certificate fingerprint verification. Used to validate certificate fingerprints without the requirement of certificate-chain verification.

+

Member Function Documentation

◆ fingerprintToBytes()

diff --git a/classksf_1_1ks_component.html b/classksf_1_1ks_component.html index ce30f7c..8795a06 100644 --- a/classksf_1_1ks_component.html +++ b/classksf_1_1ks_component.html @@ -84,6 +84,11 @@
ksf::ksComponent Class Reference
+ +

Base component class. + More...

+ +

#include <ksComponent.h>

+ Inheritance diagram for ksf::ksComponent:
@@ -92,43 +97,43 @@
-ksf::ksRtti +ksf::ksRtti ksf::comps::ksConfigProvider ksf::comps::ksDevStatMqttReporter -ksf::comps::ksDevicePortal +ksf::comps::ksDevicePortal ksf::comps::ksLed ksf::comps::ksMqttConnector ksf::comps::ksResetButton -ksf::comps::ksWifiConfigurator -ksf::comps::ksWifiConnector +ksf::comps::ksWifiConfigurator +ksf::comps::ksWifiConnector
- + - + - + - + - + - +

Public Member Functions

virtual const size_t getInstanceType () const
 This function is used to get type ID of object.
 Retrieves type ID of the object.
 
virtual bool isA (const size_t id) const
 This function is used to check if object is of given type.
 Checks whether object is of given type.
 
virtual bool init (ksApplication *app)
 Initializes component.
 
virtual bool loop (ksApplication *app)
 Called from application loop.
 Handles component loop logic, called from application loop.
 
virtual bool postInit (ksApplication *app)
 Method called after component initialization.
 Method called after component initialization, used to setup references to other components.
 
- Public Member Functions inherited from ksf::ksRtti
template<typename TType >
TType * as ()
 This function is used to cast object to given type.
 Tries to cast object to the type provided as a template parameter.
 
template<typename TType >
const TType * as () const
 This function is used to const cast object to given type.
 Tries to cast object to the type provided as a template parameter (const version).
 

@@ -148,7 +153,10 @@ class 

ksApplication
 
-

Member Function Documentation

+

Detailed Description

+

Base component class.

+

A component is a part of the application that can be configured and managed by the application. As it is using ksRtti, it must use KSF_RTTI_DECLARATIONS for proper initialization.

+

Member Function Documentation

◆ getInstanceType()

@@ -172,8 +180,8 @@

-

This function is used to get type ID of object.

-
Returns
Type ID.
+

Retrieves type ID of the object.

+
Returns
Object type ID.

Implements ksf::ksRtti.

@@ -209,15 +217,15 @@

Parameters
- +
ownerPointer to the owning application.
appPointer to the parent ksApplication.
Returns
True on success, false on fail.
-

Reimplemented in ksf::comps::ksDevicePortal, ksf::comps::ksResetButton, ksf::comps::ksWifiConnector, ksf::comps::ksLed, ksf::comps::ksMqttConnector, and ksf::comps::ksWifiConfigurator.

+

Reimplemented in ksf::comps::ksDevicePortal, ksf::comps::ksMqttConnector, ksf::comps::ksResetButton, ksf::comps::ksWifiConfigurator, ksf::comps::ksWifiConnector, and ksf::comps::ksLed.

-

Referenced by ksf::comps::ksMqttConnector::init().

+

Referenced by ksf::comps::ksMqttConnector::init().

@@ -244,10 +252,10 @@

-

This function is used to check if object is of given type.

+

Checks whether object is of given type.

Parameters
- +
idType ID.
idType ID to check against.
@@ -282,7 +290,13 @@

-

Called from application loop.

+

Handles component loop logic, called from application loop.

+
Parameters
+ + +
appPointer to the parent ksApplication.
+
+
Returns
True on success, false on fail.

Reimplemented in ksf::comps::ksDevicePortal, ksf::comps::ksDevStatMqttReporter, ksf::comps::ksLed, ksf::comps::ksMqttConnector, ksf::comps::ksResetButton, ksf::comps::ksWifiConfigurator, and ksf::comps::ksWifiConnector.

@@ -312,16 +326,16 @@

-

Method called after component initialization.

+

Method called after component initialization, used to setup references to other components.

Parameters
- +
ownerPointer to the owning application.
appPointer to the parent ksApplication.
Returns
True on success, false on fail.
-

Reimplemented in ksf::comps::ksDevicePortal, ksf::comps::ksDevStatMqttReporter, ksf::comps::ksMqttConnector, and ksf::comps::ksWifiConfigurator.

+

Reimplemented in ksf::comps::ksDevicePortal, ksf::comps::ksDevStatMqttReporter, ksf::comps::ksMqttConnector, and ksf::comps::ksWifiConfigurator.

diff --git a/classksf_1_1ks_config.html b/classksf_1_1ks_config.html index 7b27bb7..1ad72a0 100644 --- a/classksf_1_1ks_config.html +++ b/classksf_1_1ks_config.html @@ -82,14 +82,19 @@
ksf::ksConfig Class Reference
+ +

Implements low-level configuration file handling. + More...

+ +

#include <ksConfig.h>

- + - + @@ -97,8 +102,9 @@ - - + +

Public Member Functions

 ksConfig (const std::string &fileName)
 Constructor that opens (or creates) specified config file and loads its contents into memory.
 Constructor tha opens or creates configuration file.
 
void setParam (const std::string &paramName, const std::string paramValue)
 Sets parameter value.
 Sets parameter value (creates new parameter if it does not exist).
 
const std::string & getParam (const std::string &paramName, const std::string &defaultValue=std::string()) const
 Retrieves parameter value.
 operator bool () const
 Operator bool override. Returns true if configFilename is not empty.
 
virtual ~ksConfig ()
 Saves config content to flash.
+virtual ~ksConfig ()
 Saves config content on the device filesystem. In case there is no modification, nothing should actually happen.
 

@@ -116,7 +122,10 @@

 Config filename.
 
-

Constructor & Destructor Documentation

+

Detailed Description

+

Implements low-level configuration file handling.

+

Uses std::map to store configuration parameters. When any parameter is modified, the config file is marked as dirty. Then on destruction, the config file is saved if it has been modified (marked as dirty) into the filesystem.

+

Constructor & Destructor Documentation

◆ ksConfig()

@@ -132,46 +141,16 @@

-

Constructor that opens (or creates) specified config file and loads its contents into memory.

+

Constructor tha opens or creates configuration file.

Parameters
- +
configFileConfig file name
fileNameConfig filename.

References configPath, and setParam().

-

- - -

◆ ~ksConfig()

- -
-
- - - - - -
- - - - - - - -
ksf::ksConfig::~ksConfig ()
-
-virtual
-
- -

Saves config content to flash.

-

If config contents has not been modified, nothing will be saved.

- -

References configParams, configPath, and isDirty.

-

Member Function Documentation

@@ -195,15 +174,14 @@

Retrieves parameter value.

-

If parameter does not exist, defaultValue will be returned.

Parameters
- - + +
paramNameParameter name
defaultValueDefault value to return if parameter does not exist
paramNameName of the parameter to retrieve.
defaultValueDefault value to return if parameter does not exist.
-
Returns
Parameter value or defaultValue if parameter does not exist.
+
Returns
Parameter value string (or defaultValue).

References configParams.

@@ -250,12 +228,11 @@

-

Sets parameter value.

-

If parameter does not exist, it will be created.

+

Sets parameter value (creates new parameter if it does not exist).

Parameters
- - + +
paramNameParameter name
paramValueParameter value (use std::move when possible)
paramNameParameter name.
paramValueParameter value (use std::move when possible).
diff --git a/classksf_1_1ks_rtti.html b/classksf_1_1ks_rtti.html index 0032629..d2ffe38 100644 --- a/classksf_1_1ks_rtti.html +++ b/classksf_1_1ks_rtti.html @@ -81,6 +81,11 @@
ksf::ksRtti Class Referenceabstract
+ +

Implements RTTI (run-time type information) for objects. + More...

+ +

#include <ksRtti.h>

+ Inheritance diagram for ksf::ksRtti:
@@ -89,36 +94,40 @@
-ksf::ksComponent +ksf::ksComponent ksf::comps::ksConfigProvider ksf::comps::ksDevStatMqttReporter -ksf::comps::ksDevicePortal +ksf::comps::ksDevicePortal ksf::comps::ksLed ksf::comps::ksMqttConnector ksf::comps::ksResetButton -ksf::comps::ksWifiConfigurator -ksf::comps::ksWifiConnector +ksf::comps::ksWifiConfigurator +ksf::comps::ksWifiConnector
- + - + - + - +

Public Member Functions

virtual const size_t getInstanceType () const =0
 This function is used to get type ID of object.
 Retrieves type ID of the object.
 
virtual bool isA (const size_t id) const
 This function is used to check if object is of given type.
 Checks whether object is of given type.
 
template<typename TType >
TType * as ()
 This function is used to cast object to given type.
 Tries to cast object to the type provided as a template parameter.
 
template<typename TType >
const TType * as () const
 This function is used to const cast object to given type.
 Tries to cast object to the type provided as a template parameter (const version).
 
-

Member Function Documentation

+

Detailed Description

+

Implements RTTI (run-time type information) for objects.

+

This is a simple, but fast and lightweight implementation of RTTI feature. Provides the ability to check whether object is of given type and cast it to the type provided as a template parameter.

+

Extensively used to implement components - ksComponent and easily manage components in the application (ksApplication).

+

Member Function Documentation

◆ as() [1/2]

@@ -144,7 +153,13 @@

-

This function is used to cast object to given type.

+

Tries to cast object to the type provided as a template parameter.

+
Template Parameters
+ + +
TTypeTarget type.
+
+
Returns
Pointer to object of given type or nullptr if object is not of given type.

@@ -174,7 +189,13 @@

-

This function is used to const cast object to given type.

+

Tries to cast object to the type provided as a template parameter (const version).

+
Template Parameters
+ + +
TTypeTarget type.
+
+
Returns
Const pointer to object of given type or nullptr if object is not of given type.
@@ -202,8 +223,8 @@

-

This function is used to get type ID of object.

-
Returns
Type ID.
+

Retrieves type ID of the object.

+
Returns
Object type ID.

Implemented in ksf::comps::ksConfigProvider, ksf::comps::ksDevicePortal, ksf::comps::ksDevStatMqttReporter, ksf::comps::ksLed, ksf::comps::ksMqttConfigProvider, ksf::comps::ksMqttConnector, ksf::comps::ksResetButton, ksf::comps::ksWifiConfigurator, ksf::comps::ksWifiConnector, and ksf::ksComponent.

@@ -232,10 +253,10 @@

-

This function is used to check if object is of given type.

+

Checks whether object is of given type.

Parameters
- +
idType ID.
idType ID to check against.
diff --git a/classksf_1_1ks_simple_timer.html b/classksf_1_1ks_simple_timer.html index 1d197d9..7bd6bfc 100644 --- a/classksf_1_1ks_simple_timer.html +++ b/classksf_1_1ks_simple_timer.html @@ -82,6 +82,11 @@
ksf::ksSimpleTimer Class Reference
+ +

Simple timer class, without using component architecture. + More...

+ +

#include <ksSimpleTimer.h>

@@ -96,10 +101,10 @@ - + - +

Public Member Functions

 Restarts timer. Will set last trigger time to current time w/o triggering the timer).
 
bool triggered ()
 Checks if timer interval just passed. Restarting timer is automatic. If interval is 0 then always returns false.
 Checks if timer interval just passed and resets the timer in this case. If timer interval is 0 then always returns false.
 
bool hasTimePassed () const
 Checks if timer interval just passed. Restarting timer relies on user. If interval is 0 then always returns false.
 Checks if timer interval just passed. Restarting timer relies on user. If timer interval is 0 then always returns false.
 

@@ -113,7 +118,14 @@

 Last trigger time (milliseconds).
 
-

Constructor & Destructor Documentation

+

Detailed Description

+

Simple timer class, without using component architecture.

+

Used to trigger events periodically. Internally checks if timer interval just passed. When interval is 0, never triggers the timer.

+

There are two ways to use it:

+

Constructor & Destructor Documentation

◆ ksSimpleTimer()

@@ -157,7 +169,7 @@

-

Checks if timer interval just passed. Restarting timer relies on user. If interval is 0 then always returns false.

+

Checks if timer interval just passed. Restarting timer relies on user. If timer interval is 0 then always returns false.

Returns
True if timer interval just passed, otherwise false.

References intervalMs, and lastTriggerTimeMs.

@@ -210,12 +222,12 @@

-

Checks if timer interval just passed. Restarting timer is automatic. If interval is 0 then always returns false.

+

Checks if timer interval just passed and resets the timer in this case. If timer interval is 0 then always returns false.

Returns
True if timer just triggered, otherwise false.

References hasTimePassed(), and restart().

-

Referenced by ksf::comps::ksWifiConfigurator::loop(), and ksf::comps::ksWifiConnector::loop().

+

Referenced by ksf::comps::ksDevStatMqttReporter::loop(), ksf::comps::ksWifiConfigurator::loop(), and ksf::comps::ksWifiConnector::loop().

diff --git a/classksf_1_1misc_1_1ks_w_s_server.html b/classksf_1_1misc_1_1ks_w_s_server.html index 879cdc6..bd05928 100644 --- a/classksf_1_1misc_1_1ks_w_s_server.html +++ b/classksf_1_1misc_1_1ks_w_s_server.html @@ -95,34 +95,34 @@

Public Member Functions

 ksWSServer (uint16_t port) - Prepares ksWebServer on specified port but does not start it (call begin).
+ Prepares ksWebServer on specified port without actually starting it.
  uint64_t getRequiredAuthToken () const - Returns simple authtoken for WebSocket authentication.
+ Returns simple authentication token for WebSocket authentication process.
  void setRequiredAuthToken (uint64_t authToken)  Sets simple authtoken for WebSocket authentication.
  void begin () - Starts the server listening on the specified port.
+ Starts the server.
  void loop () - Handles server logic.
+ Handles WebSocket server logic.
  void setMessageHandler (ksWsServerMessageFunc_t func) - Installs a message handler callback to WebSocket text receive messages.
+ Installs a message handler to receive WebSocket text messages.
  virtual ~ksWSServer () - Releases server resources.
+ Destructs the server, releasing the resources.
  - +

Protected Member Functions

void handleNonWebsocketConnection (WSclient_t *client) override
 Handles a situation wher the socket is not authorized.
 Handler for non-WebSocket connections on websocket port.
 
- - - - + + + + - - - + + + - + - - - + + +

@@ -156,10 +156,10 @@

-

Prepares ksWebServer on specified port but does not start it (call begin).

+

Prepares ksWebServer on specified port without actually starting it.

Parameters
- +
portWebSocket listening port.
portPort to listen for incoming WebSocket connections.
@@ -184,8 +184,9 @@

-

Returns simple authtoken for WebSocket authentication.

-

The value 0 is considered to be invalid (no auth token). Auth token is set via setRequiredAuthToken(). Generally, this token should be generated earlier, then the WebServer should use Cookie to transmit it to the browser and then the browser should pass it with WebSocket requests (via HTTP Cookie header).

+

Returns simple authentication token for WebSocket authentication process.

+

The value 0 is considered to be empty token. Authentication token is set via setRequiredAuthToken().

+

Generally, this token should be generated earlier, then the WebServer should use Cookie to transmit it to the browser and then the browser should pass it with WebSocket requests (via HTTP Cookie header).

Returns
Auth token for WebSocket

References requriedAuthToken.

@@ -215,10 +216,10 @@

-

Handles a situation wher the socket is not authorized.

+

Handler for non-WebSocket connections on websocket port.

Parameters
- +
clientWSclient_t * ptr to the client struct
clientSPointer to the WSclient_t object.
@@ -240,10 +241,10 @@

-

Installs a message handler callback to WebSocket text receive messages.

+

Installs a message handler to receive WebSocket text messages.

Parameters
- +
funcCallback function to receive messages
funcThe message handler function.
@@ -271,7 +272,7 @@

setRequiredAuthToken(). Generally, this token should be generated earlier, then the WebServer should use Cookie to transmit it to the browser and then the browser should pass it with WebSocket requests (via HTTP Cookie header).

Parameters
- +
authTokenThe token to set
authTokenThe token to set.
diff --git a/doxygen_crawl.html b/doxygen_crawl.html index 64b9ebb..8df638b 100644 --- a/doxygen_crawl.html +++ b/doxygen_crawl.html @@ -65,6 +65,8 @@ + + @@ -84,6 +86,13 @@ + + + + + + + diff --git a/functions.html b/functions.html index 7e72fea..97639ad 100644 --- a/functions.html +++ b/functions.html @@ -77,7 +77,7 @@

- a -

diff --git a/functions_func.html b/functions_func.html index 732b761..5e6d4c0 100644 --- a/functions_func.html +++ b/functions_func.html @@ -122,7 +122,7 @@

- h -

 Cksf::evt::ksEvent< const std::string_view &, bool &, std::string & >
 Cksf::evt::ksEvent< const std::string_view &, const std::string_view & >
 Cksf::evt::ksEvent< Params >
 Cksf::ksApplication
 Cksf::ksAppRotator< AppTypes >
 Cksf::ksCertFingerprint
 Cksf::ksConfig
 Cksf::ksApplicationA class that is a base for user-defined application
 Cksf::ksAppRotator< AppTypes >Application rotator component
 Cksf::ksCertFingerprintInterface for certificate fingerprint verification
 Cksf::ksConfigImplements low-level configuration file handling
 Cksf::comps::ksConfigParameterA structure that defines configuration parameter
 Cksf::evt::ksEventHandle
 Cksf::ksRtti
 Cksf::ksComponent
 Cksf::comps::ksConfigProviderA component that provides a set of parameters to the ksWifiConfigurator and is also responsible for handling its storage
 Cksf::ksRttiImplements RTTI (run-time type information) for objects
 Cksf::ksComponentBase component class
 Cksf::comps::ksConfigProviderA component that provides a set of parameters to the ksWifiConfigurator and is also responsible for handling its storage
 Cksf::comps::ksMqttConfigProviderA component that manages MQTT-related configuration
 Cksf::comps::ksDevStatMqttReporterA component that periodocally reports device state to the broker
 Cksf::comps::ksDevicePortal
 Cksf::comps::ksDevicePortalA component thet implements web-based configuration portal accessible from local network
 Cksf::comps::ksLedA component that simplifies driving the LED
 Cksf::comps::ksMqttConnectorA component which is responsible for MQTT connection management
 Cksf::comps::ksResetButtonA component that implements reset button functionality
 Cksf::comps::ksWifiConfigurator
 Cksf::comps::ksWifiConnector
 Cksf::ksSimpleTimer
 Cksf::comps::ksWifiConfiguratorKsWifiConfigurator component class
 Cksf::comps::ksWifiConnectorA component that manages WiFi connection
 Cksf::ksSimpleTimerSimple timer class, without using component architecture
 CWebSocketsServerCore
 Cksf::misc::ksWSServer
diff --git a/ks_app_rotator_8h_source.html b/ks_app_rotator_8h_source.html index 7101272..6c6c5dc 100644 --- a/ks_app_rotator_8h_source.html +++ b/ks_app_rotator_8h_source.html @@ -112,57 +112,57 @@
36
37namespace ksf
38{
-
39 template <class... AppTypes>
-
- -
41 {
-
42 private:
-
43 uint8_t appIndex{0};
-
44 std::unique_ptr<ksApplication> currentApplication{nullptr};
-
45 typedef std::unique_ptr<ksApplication> (*TSpawnerFunc)();
-
46
-
51 template <class T>
-
52 static std::unique_ptr<ksApplication> spawnApp()
-
53 {
-
54 return std::make_unique<T>();
-
55 }
-
56
-
57 static constexpr std::array<TSpawnerFunc, sizeof...(AppTypes)> appSpawners{spawnApp<AppTypes>...};
-
58
-
59 public:
-
- -
64 {
-
65 /* If current application is valid and we looped, then we're done. */
-
66 if (currentApplication && currentApplication->loop())
-
67 return;
-
68
-
69 /* Spawn application. */
-
70 currentApplication = appSpawners[appIndex]();
-
71
-
72 /* If not initialized, then destroy and try to do our business next delay. */
-
73 if (!currentApplication->init())
-
74 currentApplication.reset(nullptr);
-
75
-
76 /* Set next app index. */
-
77 if (++appIndex >= appSpawners.size())
-
78 appIndex = 0;
-
79 }
-
+
43 template <class... AppTypes>
+
+ +
45 {
+
46 private:
+
47 uint8_t appIndex{0};
+
48 std::unique_ptr<ksApplication> currentApplication{nullptr};
+
49 typedef std::unique_ptr<ksApplication> (*TSpawnerFunc)();
+
50
+
56 template <class TApplicationType>
+
57 static std::unique_ptr<ksApplication> spawnApp()
+
58 {
+
59 return std::make_unique<TApplicationType>();
+
60 }
+
61
+
62 static constexpr std::array<TSpawnerFunc, sizeof...(AppTypes)> appSpawners{spawnApp<AppTypes>...};
+
63
+
64 public:
+
+ +
69 {
+
70 /* If current application is valid and we looped, then we're done. */
+
71 if (currentApplication && currentApplication->loop())
+
72 return;
+
73
+
74 /* Spawn application. */
+
75 currentApplication = appSpawners[appIndex]();
+
76
+
77 /* If not initialized, then destroy and try to do our business next delay. */
+
78 if (!currentApplication->init())
+
79 currentApplication.reset(nullptr);
80
-
-
85 void loop(unsigned long milliseconds)
-
86 {
- -
88 delay(milliseconds);
-
89 }
+
81 /* Set next app index. */
+
82 if (++appIndex >= appSpawners.size())
+
83 appIndex = 0;
+
84 }
+
+
85
+
+
90 void loop(unsigned long milliseconds)
+
91 {
+ +
93 delay(milliseconds);
+
94 }
-
90 };
+
95 };
-
91}
-
Definition ksAppRotator.h:41
-
void loopNoDelay()
Runs the application loop.
Definition ksAppRotator.h:63
-
void loop(unsigned long milliseconds)
Runs the application loop with a delay.
Definition ksAppRotator.h:85
+
96}
+
Application rotator component.
Definition ksAppRotator.h:45
+
void loopNoDelay()
Runs the application loop.
Definition ksAppRotator.h:68
+
void loop(unsigned long milliseconds)
Runs application loop with a delay between loops.
Definition ksAppRotator.h:90