From 3bbedadf450a4b8842af126f10beb5a9bb48150a Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Thu, 19 Mar 2020 13:11:47 +0100 Subject: [PATCH 1/4] Removing default value assignment within connect function --- src/MqttClient.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MqttClient.h b/src/MqttClient.h index e0e9d63..1841832 100644 --- a/src/MqttClient.h +++ b/src/MqttClient.h @@ -65,8 +65,8 @@ class MqttClient : public Client { void poll(); // from Client - virtual int connect(IPAddress ip, uint16_t port = 1883); - virtual int connect(const char *host, uint16_t port = 1883); + virtual int connect(IPAddress ip, uint16_t port); + virtual int connect(const char *host, uint16_t port); #ifdef ESP8266 virtual int connect(const IPAddress& ip, uint16_t port) { return 0; }; /* ESP8266 core defines this pure virtual in Client.h */ #endif From 6f107d082fd2969c73bffec28129f0bf68893bbb Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Mon, 23 Mar 2020 07:43:57 +0100 Subject: [PATCH 2/4] Since we have a different signature for ESP8266 2.5.0 core for the connect function we need to provide two slightly different definitions dependending wether we compile for ESP8266 or Arduino --- src/MqttClient.cpp | 4 ++++ src/MqttClient.h | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/MqttClient.cpp b/src/MqttClient.cpp index 8e2684e..43f90a2 100644 --- a/src/MqttClient.cpp +++ b/src/MqttClient.cpp @@ -623,7 +623,11 @@ void MqttClient::poll() } } +#ifndef ESP8266 int MqttClient::connect(IPAddress ip, uint16_t port) +#else +int MqttClient::connect(const IPAddress& ip, uint16_t port) +#endif { return connect(ip, NULL, port); } diff --git a/src/MqttClient.h b/src/MqttClient.h index 1841832..ff84b28 100644 --- a/src/MqttClient.h +++ b/src/MqttClient.h @@ -65,10 +65,11 @@ class MqttClient : public Client { void poll(); // from Client - virtual int connect(IPAddress ip, uint16_t port); virtual int connect(const char *host, uint16_t port); -#ifdef ESP8266 - virtual int connect(const IPAddress& ip, uint16_t port) { return 0; }; /* ESP8266 core defines this pure virtual in Client.h */ +#ifndef ESP8266 + virtual int connect(IPAddress ip, uint16_t port); +#else + virtual int connect(const IPAddress& ip, uint16_t port); /* ESP8266 core 2.5.0 defines this pure virtual in Client.h */ #endif virtual size_t write(uint8_t); virtual size_t write(const uint8_t *buf, size_t size); From f767a47ac293e0308fc687eb4cc493c8304017e0 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Mon, 23 Mar 2020 07:55:26 +0100 Subject: [PATCH 3/4] Using a more generalised ifdef filter to catch all ESP8266 boards --- src/MqttClient.cpp | 2 +- src/MqttClient.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MqttClient.cpp b/src/MqttClient.cpp index 43f90a2..97f07a5 100644 --- a/src/MqttClient.cpp +++ b/src/MqttClient.cpp @@ -623,7 +623,7 @@ void MqttClient::poll() } } -#ifndef ESP8266 +#ifndef ARDUINO_ARCH_ESP8266 int MqttClient::connect(IPAddress ip, uint16_t port) #else int MqttClient::connect(const IPAddress& ip, uint16_t port) diff --git a/src/MqttClient.h b/src/MqttClient.h index ff84b28..b46f622 100644 --- a/src/MqttClient.h +++ b/src/MqttClient.h @@ -66,7 +66,7 @@ class MqttClient : public Client { // from Client virtual int connect(const char *host, uint16_t port); -#ifndef ESP8266 +#ifndef ARDUINO_ARCH_ESP8266 virtual int connect(IPAddress ip, uint16_t port); #else virtual int connect(const IPAddress& ip, uint16_t port); /* ESP8266 core 2.5.0 defines this pure virtual in Client.h */ From 6549153096b64da0548f0c059170d7348a320efa Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Mon, 23 Mar 2020 08:15:26 +0100 Subject: [PATCH 4/4] Remove CI compilation of ESP8266 boards unless we can lock the CI build to version 2.5.0 --- .github/workflows/compile-examples.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 7aab170..6d996e2 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -12,8 +12,8 @@ jobs: "arduino:samd:mkr1000", "arduino:samd:mkrwifi1010", "arduino:samd:nano_33_iot", - "arduino:megaavr:uno2018", - '"esp8266:esp8266:huzzah" "https://arduino.esp8266.com/stable/package_esp8266com_index.json"' + "arduino:megaavr:uno2018" +# '"esp8266:esp8266:huzzah" "https://arduino.esp8266.com/stable/package_esp8266com_index.json"' ] steps: