+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+
+
- n -
+
+
+
+
+
+
diff --git a/functions_vars.html b/functions_vars.html
index 281dbbb..71af5d4 100644
--- a/functions_vars.html
+++ b/functions_vars.html
@@ -158,6 +158,11 @@
- onAnyMessage : ksf::comps::ksMqttConnector
- onConnected : ksf::comps::ksMqttConnector
@@ -212,12 +217,11 @@ - w -
diff --git a/functions_w.html b/functions_w.html
index 864e5ce..a1df05f 100644
--- a/functions_w.html
+++ b/functions_w.html
@@ -90,14 +90,13 @@ - w -
diff --git a/ks_mqtt_connector_8h_source.html b/ks_mqtt_connector_8h_source.html
index 9a90ce3..d008141 100644
--- a/ks_mqtt_connector_8h_source.html
+++ b/ks_mqtt_connector_8h_source.html
@@ -109,7 +109,7 @@
16#include "../evt/ksEvent.h"
17#include "../ksSimpleTimer.h"
-
+
21class ksCertFingerprint;
@@ -127,7 +127,7 @@
-
+
@@ -197,34 +197,34 @@
A component which is responsible for MQTT connection management.
Definition ksMqttConnector.h:37
std::weak_ptr< ksWifiConnector > wifiConnWp
Weak pointer to WiFi connector.
Definition ksMqttConnector.h:47
+std::unique_ptr< Client > netClientUq
Shared pointer to WiFiClient used to connect to MQTT.
Definition ksMqttConnector.h:44
std::string prefix
Saved MQTT prefix.
Definition ksMqttConnector.h:60
-void subscribe(const std::string &topic, bool skipDevicePrefix=false, ksMqttConnector::QosLevel=ksMqttConnector::QosLevel::QOS_AT_LEAST_ONCE)
Subscribes to MQTT topic.
Definition ksMqttConnector.cpp:155
+void subscribe(const std::string &topic, bool skipDevicePrefix=false, ksMqttConnector::QosLevel=ksMqttConnector::QosLevel::QOS_AT_LEAST_ONCE)
Subscribes to MQTT topic.
Definition ksMqttConnector.cpp:169
uint32_t getReconnectCounter() const
Retrieves MQTT reconnect counter.
Definition ksMqttConnector.h:149
-bool init(ksApplication *app) override
Instantiates the MQTT connector component.
Definition ksMqttConnector.cpp:40
-std::unique_ptr< WiFiClient > wifiClientUq
Shared pointer to WiFiClient used to connect to MQTT.
Definition ksMqttConnector.h:44
+bool init(ksApplication *app) override
Instantiates the MQTT connector component.
Definition ksMqttConnector.cpp:54
uint64_t lastSuccessConnectionTime
Time of connection to MQTT broker in seconds.
Definition ksMqttConnector.h:49
std::unique_ptr< PubSubClient > mqttClientUq
Shared pointer to PubSubClient used to connect to MQTT.
Definition ksMqttConnector.h:45
virtual ~ksMqttConnector()
Destructor (for uniqueptr purposes).
std::shared_ptr< ksf::evt::ksEvent< const std::string_view &, const std::string_view & > > onAnyMessage
onAnyMessage event that user can bind to.
Definition ksMqttConnector.h:96
-bool loop(ksApplication *app) override
Executes MQTT connection logic.
Definition ksMqttConnector.cpp:236
+bool loop(ksApplication *app) override
Executes MQTT connection logic.
Definition ksMqttConnector.cpp:250
std::unique_ptr< ksCertFingerprint > certFingerprint
Shared pointer to fingerprint validator.
Definition ksMqttConnector.h:64
std::string login
Saved MQTT login.
Definition ksMqttConnector.h:58
bool usePersistentSession
Use persistent session or not.
Definition ksMqttConnector.h:53
-uint32_t getConnectionTimeSeconds() const
Retrieves connection time in seconds.
Definition ksMqttConnector.cpp:271
+uint32_t getConnectionTimeSeconds() const
Retrieves connection time in seconds.
Definition ksMqttConnector.cpp:285
bool sendConnectionStatus
Send connection status to MQTT or not.
Definition ksMqttConnector.h:52
-void unsubscribe(const std::string &topic, bool skipDevicePrefix=false)
Unsubscribes the MQTT topic.
Definition ksMqttConnector.cpp:161
-bool isConnected() const
Retrieves connection state.
Definition ksMqttConnector.cpp:266
-void setupConnection(const std::string broker, const std::string &port, std::string login, std::string password, std::string prefix, const std::string &fingerprint)
Sets up MQTT connection.
Definition ksMqttConnector.cpp:64
+void unsubscribe(const std::string &topic, bool skipDevicePrefix=false)
Unsubscribes the MQTT topic.
Definition ksMqttConnector.cpp:175
+bool isConnected() const
Retrieves connection state.
Definition ksMqttConnector.cpp:280
+void setupConnection(const std::string broker, const std::string &port, std::string login, std::string password, std::string prefix, const std::string &fingerprint)
Sets up MQTT connection.
Definition ksMqttConnector.cpp:78
std::shared_ptr< ksf::evt::ksEvent<> > onDisconnected
onDisconnected event that user can bind to.
Definition ksMqttConnector.h:99
-void publish(const std::string &topic, const std::string &payload, bool retain=false, bool skipDevicePrefix=false)
Publishes a message to the MQTT topic.
Definition ksMqttConnector.cpp:166
+void publish(const std::string &topic, const std::string &payload, bool retain=false, bool skipDevicePrefix=false)
Publishes a message to the MQTT topic.
Definition ksMqttConnector.cpp:180
uint16_t portNumber
Saved MQTT port number.
Definition ksMqttConnector.h:62
-void mqttConnectedInternal()
Connects to the MQTT broker (internal function).
Definition ksMqttConnector.cpp:118
-bool connectToBroker()
Connects to the MQTT broker.
Definition ksMqttConnector.cpp:183
+void mqttConnectedInternal()
Connects to the MQTT broker (internal function).
Definition ksMqttConnector.cpp:132
+bool connectToBroker()
Connects to the MQTT broker.
Definition ksMqttConnector.cpp:197
ksSimpleTimer reconnectTimer
Timer that counts time between reconnection attempts.
Definition ksMqttConnector.h:56
-bool postInit(ksApplication *app) override
Method that handles component post-initialization.
Definition ksMqttConnector.cpp:58
+bool postInit(ksApplication *app) override
Method that handles component post-initialization.
Definition ksMqttConnector.cpp:72
std::string broker
Saved MQTT broker.
Definition ksMqttConnector.h:61
std::shared_ptr< ksf::evt::ksEvent<> > onConnected
onConnected event that user can bind to.
Definition ksMqttConnector.h:98
-void mqttMessageInternal(const char *topic, const uint8_t *payload, uint32_t length)
Called when MQTT message arrives (internal function).
Definition ksMqttConnector.cpp:125
+void mqttMessageInternal(const char *topic, const uint8_t *payload, uint32_t length)
Called when MQTT message arrives (internal function).
Definition ksMqttConnector.cpp:139
std::string password
Saved MQTT password.
Definition ksMqttConnector.h:59
uint32_t reconnectCounter
MQTT reconnection counter.
Definition ksMqttConnector.h:50
bool wasConnected
True if connected in previous loop.
Definition ksMqttConnector.h:54
diff --git a/ks_w_s_server_8h_source.html b/ks_w_s_server_8h_source.html
index 0dd7591..3e365db 100644
--- a/ks_w_s_server_8h_source.html
+++ b/ks_w_s_server_8h_source.html
@@ -103,53 +103,52 @@
12#include <WebSocketsServer.h>
- 13#include <WiFiServer.h>
-
-
-
-
-
- 24 typedef std::function<void(uint8_t client, std::string_view message)> ksWsServerMessageFunc_t;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
23 typedef std::function<void(uint8_t client, std::string_view message)> ksWsServerMessageFunc_t;
+
+
+
+
+
+
31 std::unique_ptr<WEBSOCKETS_NETWORK_SERVER_CLASS>
wsListener;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
Wrapper around WebSocketsServerCore that adds WebSocket authentication and better message handling.
Definition ksWSServer.h:30
+
+
Wrapper around WebSocketsServerCore that adds WebSocket authentication and better message handling.
Definition ksWSServer.h:29
+
std::unique_ptr< WEBSOCKETS_NETWORK_SERVER_CLASS > wsListener
WS server (listener).
Definition ksWSServer.h:31
virtual ~ksWSServer()
Destructs the server, releasing the resources.
Definition ksWSServer.cpp:22
void begin()
Starts the server.
Definition ksWSServer.cpp:27
void loop()
Handles WebSocket server logic.
Definition ksWSServer.cpp:59
ksWSServer(uint16_t port)
Prepares ksWebServer on specified port without actually starting it.
Definition ksWSServer.cpp:17
-
ksWsServerMessageFunc_t onWebsocketTextMessage
Callback function to receive messages.
Definition ksWSServer.h:34
+
ksWsServerMessageFunc_t onWebsocketTextMessage
Callback function to receive messages.
Definition ksWSServer.h:33
uint64_t getRequiredAuthToken() const
Returns simple authentication token for WebSocket authentication process.
Definition ksWSServer.cpp:82
-
std::unique_ptr< WiFiServer > wsListener
WS server (listener).
Definition ksWSServer.h:32
void setMessageHandler(ksWsServerMessageFunc_t func)
Installs a message handler to receive WebSocket text messages.
Definition ksWSServer.cpp:77
void handleNonWebsocketConnection(WSclient_t *client) override
Handler for non-WebSocket connections on websocket port.
Definition ksWSServer.cpp:92
void setRequiredAuthToken(uint64_t authToken)
Sets simple authtoken for WebSocket authentication.
Definition ksWSServer.cpp:87
-
uint64_t requriedAuthToken
WS auth token.
Definition ksWSServer.h:33
+
uint64_t requriedAuthToken
WS auth token.
Definition ksWSServer.h:32