diff --git a/ks_constants_8h_source.html b/ks_constants_8h_source.html index b77876b..46c97ef 100644 --- a/ks_constants_8h_source.html +++ b/ks_constants_8h_source.html @@ -118,8 +118,8 @@
32#define KSF_MQTT_RECONNECT_DELAY_MS 5000UL
33#endif
34
-
35#ifndef KSF_MQTT_TIMEOUT_SEC
-
37#define KSF_MQTT_TIMEOUT_SEC 4UL
+
35#ifndef KSF_MQTT_TIMEOUT_MS
+
37#define KSF_MQTT_TIMEOUT_MS 4000UL
38#endif
39
40#ifndef KSF_WIFI_TIMEOUT_MS
diff --git a/ks_mqtt_connector_8h_source.html b/ks_mqtt_connector_8h_source.html index 7728b08..97047c2 100644 --- a/ks_mqtt_connector_8h_source.html +++ b/ks_mqtt_connector_8h_source.html @@ -207,32 +207,32 @@
ksf::comps::ksMqttConnector::wifiConnWp
std::weak_ptr< ksWifiConnector > wifiConnWp
Weak pointer to WiFi connector.
Definition ksMqttConnector.h:55
ksf::comps::ksMqttConnector::netClientUq
std::unique_ptr< WiFiClient > netClientUq
Shared pointer to WiFiClient used to connect to MQTT.
Definition ksMqttConnector.h:52
ksf::comps::ksMqttConnector::prefix
std::string prefix
Saved MQTT prefix.
Definition ksMqttConnector.h:68
-
ksf::comps::ksMqttConnector::subscribe
void subscribe(const std::string &topic, bool skipDevicePrefix=false, ksMqttConnector::QosLevel=ksMqttConnector::QosLevel::QOS_AT_LEAST_ONCE)
Subscribes to MQTT topic.
Definition ksMqttConnector.cpp:135
+
ksf::comps::ksMqttConnector::subscribe
void subscribe(const std::string &topic, bool skipDevicePrefix=false, ksMqttConnector::QosLevel=ksMqttConnector::QosLevel::QOS_AT_LEAST_ONCE)
Subscribes to MQTT topic.
Definition ksMqttConnector.cpp:143
ksf::comps::ksMqttConnector::getReconnectCounter
uint32_t getReconnectCounter() const
Retrieves MQTT reconnect counter.
Definition ksMqttConnector.h:157
ksf::comps::ksMqttConnector::init
bool init(ksApplication *app) override
Instantiates the MQTT connector component.
Definition ksMqttConnector.cpp:42
ksf::comps::ksMqttConnector::lastSuccessConnectionTime
uint64_t lastSuccessConnectionTime
Time of connection to MQTT broker in seconds.
Definition ksMqttConnector.h:57
ksf::comps::ksMqttConnector::mqttClientUq
std::unique_ptr< PubSubClient > mqttClientUq
Shared pointer to PubSubClient used to connect to MQTT.
Definition ksMqttConnector.h:53
ksf::comps::ksMqttConnector::~ksMqttConnector
virtual ~ksMqttConnector()
Destructor (for uniqueptr purposes).
ksf::comps::ksMqttConnector::onAnyMessage
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:104
-
ksf::comps::ksMqttConnector::loop
bool loop(ksApplication *app) override
Executes MQTT connection logic.
Definition ksMqttConnector.cpp:215
+
ksf::comps::ksMqttConnector::loop
bool loop(ksApplication *app) override
Executes MQTT connection logic.
Definition ksMqttConnector.cpp:223
ksf::comps::ksMqttConnector::certFingerprint
std::unique_ptr< ksCertFingerprint > certFingerprint
Shared pointer to fingerprint validator.
Definition ksMqttConnector.h:72
ksf::comps::ksMqttConnector::login
std::string login
Saved MQTT login.
Definition ksMqttConnector.h:66
ksf::comps::ksMqttConnector::usePersistentSession
bool usePersistentSession
Use persistent session or not.
Definition ksMqttConnector.h:61
-
ksf::comps::ksMqttConnector::getConnectionTimeSeconds
uint32_t getConnectionTimeSeconds() const
Retrieves connection time in seconds.
Definition ksMqttConnector.cpp:250
+
ksf::comps::ksMqttConnector::getConnectionTimeSeconds
uint32_t getConnectionTimeSeconds() const
Retrieves connection time in seconds.
Definition ksMqttConnector.cpp:258
ksf::comps::ksMqttConnector::sendConnectionStatus
bool sendConnectionStatus
Send connection status to MQTT or not.
Definition ksMqttConnector.h:60
-
ksf::comps::ksMqttConnector::unsubscribe
void unsubscribe(const std::string &topic, bool skipDevicePrefix=false)
Unsubscribes the MQTT topic.
Definition ksMqttConnector.cpp:141
-
ksf::comps::ksMqttConnector::isConnected
bool isConnected() const
Retrieves connection state.
Definition ksMqttConnector.cpp:245
+
ksf::comps::ksMqttConnector::unsubscribe
void unsubscribe(const std::string &topic, bool skipDevicePrefix=false)
Unsubscribes the MQTT topic.
Definition ksMqttConnector.cpp:149
+
ksf::comps::ksMqttConnector::isConnected
bool isConnected() const
Retrieves connection state.
Definition ksMqttConnector.cpp:253
ksf::comps::ksMqttConnector::setupConnection
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:66
ksf::comps::ksMqttConnector::onDisconnected
std::shared_ptr< ksf::evt::ksEvent<> > onDisconnected
onDisconnected event that user can bind to.
Definition ksMqttConnector.h:107
-
ksf::comps::ksMqttConnector::publish
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:146
+
ksf::comps::ksMqttConnector::publish
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:154
ksf::comps::ksMqttConnector::portNumber
uint16_t portNumber
Saved MQTT port number.
Definition ksMqttConnector.h:70
-
ksf::comps::ksMqttConnector::mqttConnectedInternal
void mqttConnectedInternal()
Connects to the MQTT broker (internal function).
Definition ksMqttConnector.cpp:98
-
ksf::comps::ksMqttConnector::connectToBroker
bool connectToBroker()
Connects to the MQTT broker.
Definition ksMqttConnector.cpp:163
+
ksf::comps::ksMqttConnector::mqttConnectedInternal
void mqttConnectedInternal()
Connects to the MQTT broker (internal function).
Definition ksMqttConnector.cpp:106
+
ksf::comps::ksMqttConnector::connectToBroker
bool connectToBroker()
Connects to the MQTT broker.
Definition ksMqttConnector.cpp:171
ksf::comps::ksMqttConnector::reconnectTimer
ksSimpleTimer reconnectTimer
Timer that counts time between reconnection attempts.
Definition ksMqttConnector.h:64
ksf::comps::ksMqttConnector::postInit
bool postInit(ksApplication *app) override
Method that handles component post-initialization.
Definition ksMqttConnector.cpp:60
ksf::comps::ksMqttConnector::broker
std::string broker
Saved MQTT broker.
Definition ksMqttConnector.h:69
ksf::comps::ksMqttConnector::onConnected
std::shared_ptr< ksf::evt::ksEvent<> > onConnected
onConnected event that user can bind to.
Definition ksMqttConnector.h:106
-
ksf::comps::ksMqttConnector::mqttMessageInternal
void mqttMessageInternal(const char *topic, const uint8_t *payload, uint32_t length)
Called when MQTT message arrives (internal function).
Definition ksMqttConnector.cpp:105
+
ksf::comps::ksMqttConnector::mqttMessageInternal
void mqttMessageInternal(const char *topic, const uint8_t *payload, uint32_t length)
Called when MQTT message arrives (internal function).
Definition ksMqttConnector.cpp:113
ksf::comps::ksMqttConnector::password
std::string password
Saved MQTT password.
Definition ksMqttConnector.h:67
ksf::comps::ksMqttConnector::reconnectCounter
uint32_t reconnectCounter
MQTT reconnection counter.
Definition ksMqttConnector.h:58
ksf::comps::ksMqttConnector::wasConnected
bool wasConnected
True if connected in previous loop.
Definition ksMqttConnector.h:62