Skip to content

Commit

Permalink
fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
bertmelis authored Dec 19, 2023
1 parent 7d36d54 commit 6233969
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion examples/largepayload-esp8266/largepayload-esp8266.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

WiFiEventHandler wifiConnectHandler;
WiFiEventHandler wifiDisconnectHandler;
espMqttClient<MQTTVERSION::3_1_1> mqttClient;
espMqttClient<MQTTVERSION::V3_1_1> mqttClient;
bool reconnectMqtt = false;
uint32_t lastReconnect = 0;

Expand Down
2 changes: 1 addition & 1 deletion examples/notask-esp32/notask-esp32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define MQTT_HOST IPAddress(192, 168, 1, 10)
#define MQTT_PORT 1883

espMqttClient<MQTTVERSION::3_1_1> mqttClient(espMqttClientTypes::UseInternalTask::NO);
espMqttClient<MQTTVERSION::V3_1_1> mqttClient(espMqttClientTypes::UseInternalTask::NO);
bool reconnectMqtt = false;
uint32_t lastReconnect = 0;

Expand Down
2 changes: 1 addition & 1 deletion examples/ota-esp8266/ota-esp8266.ino
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

WiFiEventHandler wifiConnectHandler;
WiFiEventHandler wifiDisconnectHandler;
espMqttClient<MQTTVERSION::3_1_1> mqttClient;
espMqttClient<MQTTVERSION::V3_1_1> mqttClient;
bool reconnectMqtt = false;
uint32_t lastReconnect = 0;
bool disconnectFlag = false;
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-esp32-idf/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define MQTT_HOST IPAddress(192, 168, 1, 10)
#define MQTT_PORT 1883

espMqttClient<MQTTVERSION::3_1_1> mqttClient;
espMqttClient<MQTTVERSION::V3_1_1> mqttClient;
bool reconnectMqtt = false;
uint32_t lastReconnect = 0;

Expand Down
2 changes: 1 addition & 1 deletion examples/simple-esp32/simple-esp32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define MQTT_HOST IPAddress(192, 168, 1, 10)
#define MQTT_PORT 1883

espMqttClient<MQTTVERSION::3_1_1> mqttClient;
espMqttClient<MQTTVERSION::V3_1_1> mqttClient;
bool reconnectMqtt = false;
uint32_t lastReconnect = 0;

Expand Down
2 changes: 1 addition & 1 deletion examples/simple-esp8266/simple-esp8266.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

WiFiEventHandler wifiConnectHandler;
WiFiEventHandler wifiDisconnectHandler;
espMqttClient<MQTTVERSION::3_1_1> mqttClient;
espMqttClient<MQTTVERSION::V3_1_1> mqttClient;
bool reconnectMqtt = false;
uint32_t lastReconnect = 0;

Expand Down
2 changes: 1 addition & 1 deletion examples/simple-linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define MQTT_HOST IPAddress(192,168,1,10)
#define MQTT_PORT 1883

espMqttClient<MQTTVERSION::3_1_1> mqttClient;
espMqttClient<MQTTVERSION::V3_1_1> mqttClient;
std::atomic_bool exitProgram(false);

void connectToMqtt() {
Expand Down
2 changes: 1 addition & 1 deletion examples/simpleAsync-esp32/simpleAsync-esp32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define MQTT_HOST IPAddress(192, 168, 1, 10)
#define MQTT_PORT 1883

espMqttClientAsync<MQTTVERSION::3_1_1> mqttClient;
espMqttClientAsync<MQTTVERSION::V3_1_1> mqttClient;
bool reconnectMqtt = false;
uint32_t lastReconnect = 0;

Expand Down
2 changes: 1 addition & 1 deletion examples/simpleAsync-esp8266/simpleAsync-esp8266.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

WiFiEventHandler wifiConnectHandler;
WiFiEventHandler wifiDisconnectHandler;
espMqttClientAsync<MQTTVERSION::3_1_1> mqttClient;
espMqttClientAsync<MQTTVERSION::V3_1_1> mqttClient;
bool reconnectMqtt = false;
uint32_t lastReconnect = 0;

Expand Down
2 changes: 1 addition & 1 deletion examples/tls-esp32/tls-esp32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const char rootCA[] = \
" add your certificate here \n" \
"-----END CERTIFICATE-----\n";

espMqttClientSecure<MQTTVERSION::3_1_1> mqttClient(espMqttClientTypes::UseInternalTask::NO);
espMqttClientSecure<MQTTVERSION::V3_1_1> mqttClient(espMqttClientTypes::UseInternalTask::NO);
static TaskHandle_t taskHandle;
bool reconnectMqtt = false;
uint32_t lastReconnect = 0;
Expand Down
2 changes: 1 addition & 1 deletion examples/tls-esp8266/tls-esp8266.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const uint8_t fingerprint[] = {0xee, 0xbc, 0x4b, 0xf8, 0x57, 0xe3, 0xd3, 0xe4, 0

WiFiEventHandler wifiConnectHandler;
WiFiEventHandler wifiDisconnectHandler;
espMqttClientSecure<MQTTVERSION::3_1_1> mqttClient;
espMqttClientSecure<MQTTVERSION::V3_1_1> mqttClient;
bool reconnectMqtt = false;
uint32_t lastReconnect = 0;

Expand Down
6 changes: 3 additions & 3 deletions src/MqttVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
36 changes: 18 additions & 18 deletions src/espMqttClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ the LICENSE file.
template <class MQTT_VERSION>
class espMqttClient : public MqttClientSetup<espMqttClient> {
public:
espMqttClient::espMqttClient()
espMqttClient()
: MqttClientSetup(espMqttClientTypes::UseInternalTask::NO)
, _client() {
_transport = &_client;
Expand All @@ -38,38 +38,38 @@ class espMqttClient : public MqttClientSetup<espMqttClient> {
template <class MQTT_VERSION>
class espMqttClientSecure : public MqttClientSetup<espMqttClientSecure> {
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;
}
Expand All @@ -82,13 +82,13 @@ class espMqttClientSecure : public MqttClientSetup<espMqttClientSecure> {
#if defined(ARDUINO_ARCH_ESP32)
class espMqttClient : public MqttClientSetup<espMqttClient> {
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;
Expand All @@ -100,39 +100,39 @@ class espMqttClient : public MqttClientSetup<espMqttClient> {

class espMqttClientSecure : public MqttClientSetup<espMqttClientSecure> {
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;
}
Expand All @@ -145,7 +145,7 @@ class espMqttClientSecure : public MqttClientSetup<espMqttClientSecure> {
#if defined(__linux__)
class espMqttClient : public MqttClientSetup<espMqttClient> {
public:
espMqttClient::espMqttClient()
espMqttClient()
: MqttClientSetup(espMqttClientTypes::UseInternalTask::NO)
, _client() {
_transport = &_client;
Expand Down
14 changes: 7 additions & 7 deletions src/espMqttClientAsync.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ the LICENSE file.
template <class MQTT_VERSION>
class espMqttClientAsync : public MqttClientSetup<espMqttClientAsync> {
public:
espMqttClientAsync::espMqttClientAsync()
espMqttClientAsync()
: MqttClientSetup(espMqttClientTypes::UseInternalTask::NO)
, _clientAsync() {
_transport = &_clientAsync;
Expand All @@ -31,7 +31,7 @@ class espMqttClientAsync : public MqttClientSetup<espMqttClientAsync> {
_clientAsync.client.onPoll(onPollCb, this);
}

bool espMqttClientAsync::connect() {
bool connect() {
bool ret = MqttClient::connect();
loop();
return ret;
Expand All @@ -40,33 +40,33 @@ class espMqttClientAsync : public MqttClientSetup<espMqttClientAsync> {
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<espMqttClientAsync*>(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<espMqttClientAsync*>(a);
client->_clientAsync.bufData = reinterpret_cast<uint8_t*>(data);
client->_clientAsync.availableData = len;
client->loop();
}

void espMqttClientAsync::onDisconnectCb(void* a, AsyncClient* c) {
void onDisconnectCb(void* a, AsyncClient* c) {
(void)c;
espMqttClientAsync* client = reinterpret_cast<espMqttClientAsync*>(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<espMqttClientAsync*>(a);
client->loop();
Expand Down

0 comments on commit 6233969

Please sign in to comment.