diff --git a/examples/largepayload-esp8266/largepayload-esp8266.ino b/examples/largepayload-esp8266/largepayload-esp8266.ino index fa1e1ea..6e41256 100644 --- a/examples/largepayload-esp8266/largepayload-esp8266.ino +++ b/examples/largepayload-esp8266/largepayload-esp8266.ino @@ -10,7 +10,7 @@ WiFiEventHandler wifiConnectHandler; WiFiEventHandler wifiDisconnectHandler; -espMqttClient mqttClient; +espMqttClient mqttClient; bool reconnectMqtt = false; uint32_t lastReconnect = 0; diff --git a/examples/notask-esp32/notask-esp32.ino b/examples/notask-esp32/notask-esp32.ino index 0d75c45..211a60b 100644 --- a/examples/notask-esp32/notask-esp32.ino +++ b/examples/notask-esp32/notask-esp32.ino @@ -8,7 +8,7 @@ #define MQTT_HOST IPAddress(192, 168, 1, 10) #define MQTT_PORT 1883 -espMqttClient mqttClient(espMqttClientTypes::UseInternalTask::NO); +espMqttClient mqttClient(espMqttClientTypes::UseInternalTask::NO); bool reconnectMqtt = false; uint32_t lastReconnect = 0; diff --git a/examples/ota-esp8266/ota-esp8266.ino b/examples/ota-esp8266/ota-esp8266.ino index c970fb7..76532c7 100644 --- a/examples/ota-esp8266/ota-esp8266.ino +++ b/examples/ota-esp8266/ota-esp8266.ino @@ -13,7 +13,7 @@ WiFiEventHandler wifiConnectHandler; WiFiEventHandler wifiDisconnectHandler; -espMqttClient mqttClient; +espMqttClient mqttClient; bool reconnectMqtt = false; uint32_t lastReconnect = 0; bool disconnectFlag = false; diff --git a/examples/simple-esp32-idf/main/main.cpp b/examples/simple-esp32-idf/main/main.cpp index 0db7c05..9f8f333 100644 --- a/examples/simple-esp32-idf/main/main.cpp +++ b/examples/simple-esp32-idf/main/main.cpp @@ -9,7 +9,7 @@ #define MQTT_HOST IPAddress(192, 168, 1, 10) #define MQTT_PORT 1883 -espMqttClient mqttClient; +espMqttClient mqttClient; bool reconnectMqtt = false; uint32_t lastReconnect = 0; diff --git a/examples/simple-esp32/simple-esp32.ino b/examples/simple-esp32/simple-esp32.ino index afefdbd..7bb7d4a 100644 --- a/examples/simple-esp32/simple-esp32.ino +++ b/examples/simple-esp32/simple-esp32.ino @@ -8,7 +8,7 @@ #define MQTT_HOST IPAddress(192, 168, 1, 10) #define MQTT_PORT 1883 -espMqttClient mqttClient; +espMqttClient mqttClient; bool reconnectMqtt = false; uint32_t lastReconnect = 0; diff --git a/examples/simple-esp8266/simple-esp8266.ino b/examples/simple-esp8266/simple-esp8266.ino index 23173a9..6eeedd4 100644 --- a/examples/simple-esp8266/simple-esp8266.ino +++ b/examples/simple-esp8266/simple-esp8266.ino @@ -10,7 +10,7 @@ WiFiEventHandler wifiConnectHandler; WiFiEventHandler wifiDisconnectHandler; -espMqttClient mqttClient; +espMqttClient mqttClient; bool reconnectMqtt = false; uint32_t lastReconnect = 0; diff --git a/examples/simple-linux/main.cpp b/examples/simple-linux/main.cpp index 77081f5..ed8fdc3 100644 --- a/examples/simple-linux/main.cpp +++ b/examples/simple-linux/main.cpp @@ -5,7 +5,7 @@ #define MQTT_HOST IPAddress(192,168,1,10) #define MQTT_PORT 1883 -espMqttClient mqttClient; +espMqttClient mqttClient; std::atomic_bool exitProgram(false); void connectToMqtt() { diff --git a/examples/simpleAsync-esp32/simpleAsync-esp32.ino b/examples/simpleAsync-esp32/simpleAsync-esp32.ino index 0cf7168..1e97a51 100644 --- a/examples/simpleAsync-esp32/simpleAsync-esp32.ino +++ b/examples/simpleAsync-esp32/simpleAsync-esp32.ino @@ -8,7 +8,7 @@ #define MQTT_HOST IPAddress(192, 168, 1, 10) #define MQTT_PORT 1883 -espMqttClientAsync mqttClient; +espMqttClientAsync mqttClient; bool reconnectMqtt = false; uint32_t lastReconnect = 0; diff --git a/examples/simpleAsync-esp8266/simpleAsync-esp8266.ino b/examples/simpleAsync-esp8266/simpleAsync-esp8266.ino index 4202177..63a9492 100644 --- a/examples/simpleAsync-esp8266/simpleAsync-esp8266.ino +++ b/examples/simpleAsync-esp8266/simpleAsync-esp8266.ino @@ -10,7 +10,7 @@ WiFiEventHandler wifiConnectHandler; WiFiEventHandler wifiDisconnectHandler; -espMqttClientAsync mqttClient; +espMqttClientAsync mqttClient; bool reconnectMqtt = false; uint32_t lastReconnect = 0; diff --git a/examples/tls-esp32/tls-esp32.ino b/examples/tls-esp32/tls-esp32.ino index f48adfd..fbcf5e4 100644 --- a/examples/tls-esp32/tls-esp32.ino +++ b/examples/tls-esp32/tls-esp32.ino @@ -15,7 +15,7 @@ const char rootCA[] = \ " add your certificate here \n" \ "-----END CERTIFICATE-----\n"; -espMqttClientSecure mqttClient(espMqttClientTypes::UseInternalTask::NO); +espMqttClientSecure mqttClient(espMqttClientTypes::UseInternalTask::NO); static TaskHandle_t taskHandle; bool reconnectMqtt = false; uint32_t lastReconnect = 0; diff --git a/examples/tls-esp8266/tls-esp8266.ino b/examples/tls-esp8266/tls-esp8266.ino index a6491f8..3ccf3e9 100644 --- a/examples/tls-esp8266/tls-esp8266.ino +++ b/examples/tls-esp8266/tls-esp8266.ino @@ -14,7 +14,7 @@ const uint8_t fingerprint[] = {0xee, 0xbc, 0x4b, 0xf8, 0x57, 0xe3, 0xd3, 0xe4, 0 WiFiEventHandler wifiConnectHandler; WiFiEventHandler wifiDisconnectHandler; -espMqttClientSecure mqttClient; +espMqttClientSecure mqttClient; bool reconnectMqtt = false; uint32_t lastReconnect = 0; diff --git a/src/MqttVersion.h b/src/MqttVersion.h index 4dadef1..2f7115f 100644 --- a/src/MqttVersion.h +++ b/src/MqttVersion.h @@ -13,15 +13,15 @@ the LICENSE file. namespace MQTTVERSION { -class 3_1 { +class V3_1 { // empty }; -class 3_1_1 { +class V3_1_1 { // empty }; -class 5 { +class V5 { // empty }; diff --git a/src/espMqttClient.h b/src/espMqttClient.h index e3bb4d7..007f600 100644 --- a/src/espMqttClient.h +++ b/src/espMqttClient.h @@ -25,7 +25,7 @@ the LICENSE file. template class espMqttClient : public MqttClientSetup { public: - espMqttClient::espMqttClient() + espMqttClient() : MqttClientSetup(espMqttClientTypes::UseInternalTask::NO) , _client() { _transport = &_client; @@ -38,38 +38,38 @@ class espMqttClient : public MqttClientSetup { template class espMqttClientSecure : public MqttClientSetup { public: - espMqttClientSecure::espMqttClientSecure() + espMqttClientSecure() : MqttClientSetup(espMqttClientTypes::UseInternalTask::NO) , _client() { _transport = &_client; } - espMqttClientSecure& espMqttClientSecure::setInsecure() { + espMqttClientSecure& setInsecure() { _client.client.setInsecure(); return *this; } - espMqttClientSecure& espMqttClientSecure::setFingerprint(const uint8_t fingerprint[20]) { + espMqttClientSecure& setFingerprint(const uint8_t fingerprint[20]) { _client.client.setFingerprint(fingerprint); return *this; } - espMqttClientSecure& espMqttClientSecure::setTrustAnchors(const X509List *ta) { + espMqttClientSecure& setTrustAnchors(const X509List *ta) { _client.client.setTrustAnchors(ta); return *this; } - espMqttClientSecure& espMqttClientSecure::setClientRSACert(const X509List *cert, const PrivateKey *sk) { + espMqttClientSecure& setClientRSACert(const X509List *cert, const PrivateKey *sk) { _client.client.setClientRSACert(cert, sk); return *this; } - espMqttClientSecure& espMqttClientSecure::setClientECCert(const X509List *cert, const PrivateKey *sk, unsigned allowed_usages, unsigned cert_issuer_key_type) { + espMqttClientSecure& setClientECCert(const X509List *cert, const PrivateKey *sk, unsigned allowed_usages, unsigned cert_issuer_key_type) { _client.client.setClientECCert(cert, sk, allowed_usages, cert_issuer_key_type); return *this; } - espMqttClientSecure& espMqttClientSecure::setCertStore(CertStoreBase *certStore) { + espMqttClientSecure& setCertStore(CertStoreBase *certStore) { _client.client.setCertStore(certStore); return *this; } @@ -82,13 +82,13 @@ class espMqttClientSecure : public MqttClientSetup { #if defined(ARDUINO_ARCH_ESP32) class espMqttClient : public MqttClientSetup { public: - explicit espMqttClient::espMqttClient(espMqttClientTypes::UseInternalTask useInternalTask) + explicit espMqttClient(espMqttClientTypes::UseInternalTask useInternalTask) : MqttClientSetup(useInternalTask) , _client() { _transport = &_client; } - espMqttClient::espMqttClient(uint8_t priority, uint8_t core) + espMqttClient(uint8_t priority, uint8_t core) : MqttClientSetup(espMqttClientTypes::UseInternalTask::YES, priority, core) , _client() { _transport = &_client; @@ -100,39 +100,39 @@ class espMqttClient : public MqttClientSetup { class espMqttClientSecure : public MqttClientSetup { public: - explicit espMqttClientSecure::espMqttClientSecure(espMqttClientTypes::UseInternalTask useInternalTask) + explicit espMqttClientSecure(espMqttClientTypes::UseInternalTask useInternalTask) : MqttClientSetup(useInternalTask) , _client() { _transport = &_client; } - espMqttClientSecure::espMqttClientSecure(uint8_t priority, uint8_t core) + espMqttClientSecure(uint8_t priority, uint8_t core) : MqttClientSetup(espMqttClientTypes::UseInternalTask::YES, priority, core) , _client() { _transport = &_client; } - espMqttClientSecure& espMqttClientSecure::setInsecure() { + espMqttClientSecure& setInsecure() { _client.client.setInsecure(); return *this; } - espMqttClientSecure& espMqttClientSecure::setCACert(const char* rootCA) { + espMqttClientSecure& setCACert(const char* rootCA) { _client.client.setCACert(rootCA); return *this; } - espMqttClientSecure& espMqttClientSecure::setCertificate(const char* clientCa) { + espMqttClientSecure& setCertificate(const char* clientCa) { _client.client.setCertificate(clientCa); return *this; } - espMqttClientSecure& espMqttClientSecure::setPrivateKey(const char* privateKey) { + espMqttClientSecure& setPrivateKey(const char* privateKey) { _client.client.setPrivateKey(privateKey); return *this; } - espMqttClientSecure& espMqttClientSecure::setPreSharedKey(const char* pskIdent, const char* psKey) { + espMqttClientSecure& setPreSharedKey(const char* pskIdent, const char* psKey) { _client.client.setPreSharedKey(pskIdent, psKey); return *this; } @@ -145,7 +145,7 @@ class espMqttClientSecure : public MqttClientSetup { #if defined(__linux__) class espMqttClient : public MqttClientSetup { public: - espMqttClient::espMqttClient() + espMqttClient() : MqttClientSetup(espMqttClientTypes::UseInternalTask::NO) , _client() { _transport = &_client; diff --git a/src/espMqttClientAsync.h b/src/espMqttClientAsync.h index 69a29bc..01cd8af 100644 --- a/src/espMqttClientAsync.h +++ b/src/espMqttClientAsync.h @@ -21,7 +21,7 @@ the LICENSE file. template class espMqttClientAsync : public MqttClientSetup { public: - espMqttClientAsync::espMqttClientAsync() + espMqttClientAsync() : MqttClientSetup(espMqttClientTypes::UseInternalTask::NO) , _clientAsync() { _transport = &_clientAsync; @@ -31,7 +31,7 @@ class espMqttClientAsync : public MqttClientSetup { _clientAsync.client.onPoll(onPollCb, this); } - bool espMqttClientAsync::connect() { + bool connect() { bool ret = MqttClient::connect(); loop(); return ret; @@ -40,18 +40,18 @@ class espMqttClientAsync : public MqttClientSetup { protected: espMqttClientInternals::ClientAsync _clientAsync; - void espMqttClientAsync::_setupClient(espMqttClientAsync* c) { + void _setupClient(espMqttClientAsync* c) { (void)c; } - void espMqttClientAsync::onConnectCb(void* a, AsyncClient* c) { + void onConnectCb(void* a, AsyncClient* c) { c->setNoDelay(true); espMqttClientAsync* client = reinterpret_cast(a); client->_state = MqttClient::State::connectingTcp2; client->loop(); } - void espMqttClientAsync::onDataCb(void* a, AsyncClient* c, void* data, size_t len) { + void onDataCb(void* a, AsyncClient* c, void* data, size_t len) { (void)c; espMqttClientAsync* client = reinterpret_cast(a); client->_clientAsync.bufData = reinterpret_cast(data); @@ -59,14 +59,14 @@ class espMqttClientAsync : public MqttClientSetup { client->loop(); } - void espMqttClientAsync::onDisconnectCb(void* a, AsyncClient* c) { + void onDisconnectCb(void* a, AsyncClient* c) { (void)c; espMqttClientAsync* client = reinterpret_cast(a); client->_state = MqttClient::State::disconnectingTcp2; client->loop(); } - void espMqttClientAsync::onPollCb(void* a, AsyncClient* c) { + void onPollCb(void* a, AsyncClient* c) { (void)c; espMqttClientAsync* client = reinterpret_cast(a); client->loop();