diff --git a/.github/workflows/check-arduino.yml b/.github/workflows/check-arduino.yml
index 0d969f6..e13b990 100644
--- a/.github/workflows/check-arduino.yml
+++ b/.github/workflows/check-arduino.yml
@@ -16,10 +16,10 @@ jobs:
 
     steps:
       - name: Checkout repository
-        uses: actions/checkout@v2
+        uses: actions/checkout@v5
 
       - name: Arduino Lint
-        uses: arduino/arduino-lint-action@v1
+        uses: arduino/arduino-lint-action@v2
         with:
           compliance: specification
           library-manager: update
diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml
index 1b0a4ec..9efc84e 100644
--- a/.github/workflows/compile-examples.yml
+++ b/.github/workflows/compile-examples.yml
@@ -36,30 +36,76 @@ jobs:
               - name: arduino:megaavr
             libraries: |
               - name: WiFiNINA
+            artifact-name-suffix: arduino-megaavr-uno2018
           - fqbn: arduino:samd:mkrwifi1010
             platforms: |
               - name: arduino:samd
             libraries: |
               - name: WiFiNINA
+            artifact-name-suffix: arduino-samd-mkrwifi1010
           - fqbn: arduino:samd:mkr1000
             platforms: |
               - name: arduino:samd
             libraries: |
               - name: WiFi101
+            artifact-name-suffix: arduino-samd-mkr1000
           - fqbn: arduino:samd:nano_33_iot
             platforms: |
               - name: arduino:samd
             libraries: |
               - name: WiFiNINA
+            artifact-name-suffix: arduino-samd-nano_33_iot
+          - fqbn: arduino:mbed_portenta:envie_m7
+            platforms: |
+              - name: arduino:mbed_portenta
+            libraries: ""
+            artifact-name-suffix: arduino-mbed_portenta-envie_m7
+          - fqbn: arduino:mbed_nicla:nicla_vision
+            platforms: |
+              - name: arduino:mbed_nicla
+            libraries: ""
+            artifact-name-suffix: arduino-mbed_nicla-nicla_vision
+          - fqbn: arduino:mbed_opta:opta
+            platforms: |
+              - name: arduino:mbed_opta
+            libraries: ""
+            artifact-name-suffix: arduino-mbed_opta-opta
+          - fqbn: arduino:mbed_giga:giga
+            platforms: |
+              - name: arduino:mbed_giga
+            libraries: ""
+            artifact-name-suffix: arduino-mbed_giga-giga
+          - fqbn: arduino:renesas_portenta:portenta_c33
+            platforms: |
+              - name: arduino:renesas_portenta
+            libraries: ""
+            artifact-name-suffix: arduino-renesas_portenta-portenta_c33
+          - fqbn: arduino:renesas_uno:unor4wifi
+            platforms: |
+              - name: arduino:renesas_uno
+            libraries: ""
+            artifact-name-suffix: arduino-renesas_uno-unor4wifi
+          - fqbn: arduino:esp32:nano_nora
+            platforms: |
+              - name: arduino:esp32
+            libraries: ""
+            artifact-name-suffix: arduino-esp32-nano_nora
           - fqbn: esp8266:esp8266:huzzah
             platforms: |
               - name: esp8266:esp8266
                 source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json
             libraries: ""
+            artifact-name-suffix: esp8266-esp8266-huzzah
+          - fqbn: "esp32:esp32:esp32"
+            platforms: |
+              - name: esp32:esp32
+                source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
+            libraries: ""
+            artifact-name-suffix: esp32-esp32-esp32
 
     steps:
       - name: Checkout repository
-        uses: actions/checkout@v2
+        uses: actions/checkout@v5
 
       - name: Compile examples
         uses: arduino/compile-sketches@v1
@@ -77,8 +123,8 @@ jobs:
           sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
 
       - name: Save sketches report as workflow artifact
-        uses: actions/upload-artifact@v2
+        uses: actions/upload-artifact@v4
         with:
           if-no-files-found: error
           path: ${{ env.SKETCHES_REPORTS_PATH }}
-          name: ${{ env.SKETCHES_REPORTS_PATH }}
+          name: sketches-report-${{ matrix.board.artifact-name-suffix }}
diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml
index 652be5d..39e2a0a 100644
--- a/.github/workflows/report-size-deltas.yml
+++ b/.github/workflows/report-size-deltas.yml
@@ -20,5 +20,5 @@ jobs:
       - name: Comment size deltas reports to PRs
         uses: arduino/report-size-deltas@v1
         with:
-          # The name of the workflow artifact created by the sketch compilation workflow
-          sketches-reports-source: sketches-reports
+          # Regex matching the names of the workflow artifacts created by the "Compile Examples" workflow
+          sketches-reports-source: ^sketches-report-.+
diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml
index 01bee87..19f5d38 100644
--- a/.github/workflows/spell-check.yml
+++ b/.github/workflows/spell-check.yml
@@ -16,7 +16,7 @@ jobs:
 
     steps:
       - name: Checkout repository
-        uses: actions/checkout@v2
+        uses: actions/checkout@v5
 
       - name: Spell check
         uses: codespell-project/actions-codespell@master
diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml
new file mode 100644
index 0000000..62c898a
--- /dev/null
+++ b/.github/workflows/sync-labels.yml
@@ -0,0 +1,138 @@
+# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md
+name: Sync Labels
+
+# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
+on:
+  push:
+    paths:
+      - ".github/workflows/sync-labels.ya?ml"
+      - ".github/label-configuration-files/*.ya?ml"
+  pull_request:
+    paths:
+      - ".github/workflows/sync-labels.ya?ml"
+      - ".github/label-configuration-files/*.ya?ml"
+  schedule:
+    # Run daily at 8 AM UTC to sync with changes to shared label configurations.
+    - cron: "0 8 * * *"
+  workflow_dispatch:
+  repository_dispatch:
+
+env:
+  CONFIGURATIONS_FOLDER: .github/label-configuration-files
+  CONFIGURATIONS_ARTIFACT: label-configuration-files
+
+jobs:
+  check:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v5
+
+      - name: Download JSON schema for labels configuration file
+        id: download-schema
+        uses: carlosperate/download-file-action@v2
+        with:
+          file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json
+          location: ${{ runner.temp }}/label-configuration-schema
+
+      - name: Install JSON schema validator
+        run: |
+          sudo npm install \
+            --global \
+            ajv-cli \
+            ajv-formats
+
+      - name: Validate local labels configuration
+        run: |
+          # See: https://github.com/ajv-validator/ajv-cli#readme
+          ajv validate \
+            --all-errors \
+            -c ajv-formats \
+            -s "${{ steps.download-schema.outputs.file-path }}" \
+            -d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}"
+
+  download:
+    needs: check
+    runs-on: ubuntu-latest
+
+    strategy:
+      matrix:
+        filename:
+          # Filenames of the shared configurations to apply to the repository in addition to the local configuration.
+          # https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/sync-labels
+          - universal.yml
+
+    steps:
+      - name: Download
+        uses: carlosperate/download-file-action@v2
+        with:
+          file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}
+
+      - name: Pass configuration files to next job via workflow artifact
+        uses: actions/upload-artifact@v4
+        with:
+          path: |
+            *.yaml
+            *.yml
+          if-no-files-found: error
+          name: ${{ env.CONFIGURATIONS_ARTIFACT }}
+
+  sync:
+    needs: download
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Set environment variables
+        run: |
+          # See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
+          echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV"
+
+      - name: Determine whether to dry run
+        id: dry-run
+        if: >
+          github.event_name == 'pull_request' ||
+          (
+            (
+              github.event_name == 'push' ||
+              github.event_name == 'workflow_dispatch'
+            ) &&
+            github.ref != format('refs/heads/{0}', github.event.repository.default_branch)
+          )
+        run: |
+          # Use of this flag in the github-label-sync command will cause it to only check the validity of the
+          # configuration.
+          echo "::set-output name=flag::--dry-run"
+
+      - name: Checkout repository
+        uses: actions/checkout@v5
+
+      - name: Download configuration files artifact
+        uses: actions/download-artifact@v5
+        with:
+          name: ${{ env.CONFIGURATIONS_ARTIFACT }}
+          path: ${{ env.CONFIGURATIONS_FOLDER }}
+
+      - name: Remove unneeded artifact
+        uses: geekyeggo/delete-artifact@v5
+        with:
+          name: ${{ env.CONFIGURATIONS_ARTIFACT }}
+
+      - name: Merge label configuration files
+        run: |
+          # Merge all configuration files
+          shopt -s extglob
+          cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}"
+
+      - name: Install github-label-sync
+        run: sudo npm install --global github-label-sync
+
+      - name: Sync labels
+        env:
+          GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        run: |
+          # See: https://github.com/Financial-Times/github-label-sync
+          github-label-sync \
+            --labels "${{ env.MERGED_CONFIGURATION_PATH }}" \
+            ${{ steps.dry-run.outputs.flag }} \
+            ${{ github.repository }}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9f11b75
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.idea/
diff --git a/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino b/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino
index ecf31ea..4b1a196 100644
--- a/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino
+++ b/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino
@@ -20,8 +20,14 @@
   #include <WiFiNINA.h>
 #elif defined(ARDUINO_SAMD_MKR1000)
   #include <WiFi101.h>
-#elif defined(ARDUINO_ESP8266_ESP12)
+#elif defined(ARDUINO_ARCH_ESP8266)
   #include <ESP8266WiFi.h>
+#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
+  #include <WiFi.h>
+#elif defined(ARDUINO_PORTENTA_C33)
+  #include <WiFiC3.h>
+#elif defined(ARDUINO_UNOR4_WIFI)
+  #include <WiFiS3.h>
 #endif
 
 #include "arduino_secrets.h"
diff --git a/examples/WiFiEcho/WiFiEcho.ino b/examples/WiFiEcho/WiFiEcho.ino
index ad04cd6..a8dc3a0 100644
--- a/examples/WiFiEcho/WiFiEcho.ino
+++ b/examples/WiFiEcho/WiFiEcho.ino
@@ -16,8 +16,14 @@
   #include <WiFiNINA.h>
 #elif defined(ARDUINO_SAMD_MKR1000)
   #include <WiFi101.h>
-#elif defined(ARDUINO_ESP8266_ESP12)
+#elif defined(ARDUINO_ARCH_ESP8266)
   #include <ESP8266WiFi.h>
+#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
+  #include <WiFi.h>
+#elif defined(ARDUINO_PORTENTA_C33)
+  #include <WiFiC3.h>
+#elif defined(ARDUINO_UNOR4_WIFI)
+  #include <WiFiS3.h>
 #endif
 
 #include "arduino_secrets.h"
diff --git a/examples/WiFiEchoCallback/WiFiEchoCallback.ino b/examples/WiFiEchoCallback/WiFiEchoCallback.ino
index 6772fb0..e409e83 100644
--- a/examples/WiFiEchoCallback/WiFiEchoCallback.ino
+++ b/examples/WiFiEchoCallback/WiFiEchoCallback.ino
@@ -17,8 +17,14 @@
   #include <WiFiNINA.h>
 #elif defined(ARDUINO_SAMD_MKR1000)
   #include <WiFi101.h>
-#elif defined(ARDUINO_ESP8266_ESP12)
+#elif defined(ARDUINO_ARCH_ESP8266)
   #include <ESP8266WiFi.h>
+#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
+  #include <WiFi.h>
+#elif defined(ARDUINO_PORTENTA_C33)
+  #include <WiFiC3.h>
+#elif defined(ARDUINO_UNOR4_WIFI)
+  #include <WiFiS3.h>
 #endif
 
 #include "arduino_secrets.h"
diff --git a/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino b/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino
index b3cde83..62c34e4 100644
--- a/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino
+++ b/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino
@@ -15,8 +15,14 @@
   #include <WiFiNINA.h>
 #elif defined(ARDUINO_SAMD_MKR1000)
   #include <WiFi101.h>
-#elif defined(ARDUINO_ESP8266_ESP12)
+#elif defined(ARDUINO_ARCH_ESP8266)
   #include <ESP8266WiFi.h>
+#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
+  #include <WiFi.h>
+#elif defined(ARDUINO_PORTENTA_C33)
+  #include <WiFiC3.h>
+#elif defined(ARDUINO_UNOR4_WIFI)
+  #include <WiFiS3.h>
 #endif
 
 #include "arduino_secrets.h"
diff --git a/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino b/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino
index 315adda..e96399d 100644
--- a/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino
+++ b/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino
@@ -16,8 +16,14 @@
   #include <WiFiNINA.h>
 #elif defined(ARDUINO_SAMD_MKR1000)
   #include <WiFi101.h>
-#elif defined(ARDUINO_ESP8266_ESP12)
+#elif defined(ARDUINO_ARCH_ESP8266)
   #include <ESP8266WiFi.h>
+#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
+  #include <WiFi.h>
+#elif defined(ARDUINO_PORTENTA_C33)
+  #include <WiFiC3.h>
+#elif defined(ARDUINO_UNOR4_WIFI)
+  #include <WiFiS3.h>
 #endif
 
 #include "arduino_secrets.h"
diff --git a/examples/WiFiSimpleSender/WiFiSimpleSender.ino b/examples/WiFiSimpleSender/WiFiSimpleSender.ino
index f2d3567..db8840e 100644
--- a/examples/WiFiSimpleSender/WiFiSimpleSender.ino
+++ b/examples/WiFiSimpleSender/WiFiSimpleSender.ino
@@ -15,8 +15,14 @@
   #include <WiFiNINA.h>
 #elif defined(ARDUINO_SAMD_MKR1000)
   #include <WiFi101.h>
-#elif defined(ARDUINO_ESP8266_ESP12)
+#elif defined(ARDUINO_ARCH_ESP8266)
   #include <ESP8266WiFi.h>
+#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
+  #include <WiFi.h>
+#elif defined(ARDUINO_PORTENTA_C33)
+  #include <WiFiC3.h>
+#elif defined(ARDUINO_UNOR4_WIFI)
+  #include <WiFiS3.h>
 #endif
 
 #include "arduino_secrets.h"
diff --git a/library.properties b/library.properties
index 5a44ad9..9b6cf4b 100644
--- a/library.properties
+++ b/library.properties
@@ -1,5 +1,5 @@
 name=ArduinoMqttClient
-version=0.1.5
+version=0.1.8
 author=Arduino
 maintainer=Arduino <info@arduino.cc>
 sentence=[BETA] Allows you to send and receive MQTT messages using Arduino.
diff --git a/src/MqttClient.cpp b/src/MqttClient.cpp
index 1f7539f..221b230 100644
--- a/src/MqttClient.cpp
+++ b/src/MqttClient.cpp
@@ -69,6 +69,7 @@ MqttClient::MqttClient(Client* client) :
   _cleanSession(true),
   _keepAliveInterval(60 * 1000L),
   _connectionTimeout(30 * 1000L),
+  _tx_payload_buffer_size(TX_PAYLOAD_BUFFER_SIZE),
   _connectError(MQTT_SUCCESS),
   _connected(false),
   _subscribeQos(0x00),
@@ -104,7 +105,11 @@ MqttClient::~MqttClient()
   }
 }
 
+#ifdef MQTT_CLIENT_STD_FUNCTION_CALLBACK
+void MqttClient::onMessage(MessageCallback callback)
+#else
 void MqttClient::onMessage(void(*callback)(int))
+#endif
 {
   _onMessage = callback;
 }
@@ -229,6 +234,7 @@ int MqttClient::endMessage()
             return 0;
           }
         }
+        yield();
       }
 
       // reply with PUBREL
@@ -244,6 +250,7 @@ int MqttClient::endMessage()
       if (_returnCode != -1) {
         return (_returnCode == 0);
       }
+      yield();
     }
 
     return 0;
@@ -284,7 +291,7 @@ int MqttClient::beginWill(const String& topic, unsigned short size, bool retain,
 
 int MqttClient::beginWill(const char* topic, bool retain, uint8_t qos)
 {
-  return beginWill(topic, TX_PAYLOAD_BUFFER_SIZE, retain, qos);
+  return beginWill(topic, _tx_payload_buffer_size, retain, qos);
 }
 
 int MqttClient::beginWill(const String& topic, bool retain, uint8_t qos)
@@ -347,6 +354,7 @@ int MqttClient::subscribe(const char* topic, uint8_t qos)
 
       return (_returnCode >= 0 && _returnCode <= 2);
     }
+    yield();
   }
 
   stop();
@@ -390,6 +398,7 @@ int MqttClient::unsubscribe(const char* topic)
     if (_returnCode != -1) {
       return (_returnCode == 0);
     }
+    yield();
   }
 
   stop();
@@ -557,7 +566,11 @@ void MqttClient::poll()
             _rxState = MQTT_CLIENT_RX_STATE_READ_PUBLISH_PAYLOAD;
 
             if (_onMessage) {
+#ifdef MQTT_CLIENT_STD_FUNCTION_CALLBACK
+              _onMessage(this,_rxLength);
+#else
               _onMessage(_rxLength);
+#endif
 
               if (_rxLength == 0) {
                 _rxState = MQTT_CLIENT_RX_STATE_READ_TYPE;
@@ -580,7 +593,11 @@ void MqttClient::poll()
           _rxState = MQTT_CLIENT_RX_STATE_READ_PUBLISH_PAYLOAD;
 
           if (_onMessage) {
+#ifdef MQTT_CLIENT_STD_FUNCTION_CALLBACK
+            _onMessage(this,_rxLength);
+#else
             _onMessage(_rxLength);
+#endif
           }
 
           if (_rxLength == 0) {
@@ -655,12 +672,12 @@ size_t MqttClient::write(const uint8_t *buf, size_t size)
     return clientWrite(buf, size);
   }
 
-  if ((_txPayloadBufferIndex + size) >= TX_PAYLOAD_BUFFER_SIZE) {
-    size = (TX_PAYLOAD_BUFFER_SIZE - _txPayloadBufferIndex);
+  if ((_txPayloadBufferIndex + size) >= _tx_payload_buffer_size) {
+    size = (_tx_payload_buffer_size - _txPayloadBufferIndex);
   }
 
   if (_txPayloadBuffer == NULL) {
-    _txPayloadBuffer = (uint8_t*)malloc(TX_PAYLOAD_BUFFER_SIZE);
+    _txPayloadBuffer = (uint8_t*)malloc(_tx_payload_buffer_size);
   }
 
   memcpy(&_txPayloadBuffer[_txPayloadBufferIndex], buf, size);
@@ -795,6 +812,17 @@ void MqttClient::setConnectionTimeout(unsigned long timeout)
   _connectionTimeout = timeout;
 }
 
+void MqttClient::setTxPayloadSize(unsigned short size)
+{
+  if (_txPayloadBuffer) {
+    free(_txPayloadBuffer);
+    _txPayloadBuffer = NULL;
+    _txPayloadBufferIndex = 0;
+  }
+    
+  _tx_payload_buffer_size = size;
+}
+
 int MqttClient::connectError() const
 {
   return _connectError;
@@ -913,6 +941,7 @@ int MqttClient::connect(IPAddress ip, const char* host, uint16_t port)
     if (_returnCode != MQTT_CONNECTION_TIMEOUT) {
       break;
     }
+    yield();
   }
 
   _connectError = _returnCode;
diff --git a/src/MqttClient.h b/src/MqttClient.h
index de19a98..522f023 100644
--- a/src/MqttClient.h
+++ b/src/MqttClient.h
@@ -32,17 +32,26 @@
 #define MQTT_BAD_USER_NAME_OR_PASSWORD      4
 #define MQTT_NOT_AUTHORIZED                 5
 
+// Make this definition in your application code to use std::functions for onMessage callbacks instead of C-pointers:
+// #define MQTT_CLIENT_STD_FUNCTION_CALLBACK
+
+#ifdef MQTT_CLIENT_STD_FUNCTION_CALLBACK
+#include <functional>
+#endif
+
 class MqttClient : public Client {
 public:
   MqttClient(Client* client);
   MqttClient(Client& client);
   virtual ~MqttClient();
 
-
+#ifdef MQTT_CLIENT_STD_FUNCTION_CALLBACK
+  typedef std::function<void(MqttClient *client, int messageSize)> MessageCallback;
+  void onMessage(MessageCallback callback);
+#else
   inline void setClient(Client& client) { _client = &client; }
-
-
   void onMessage(void(*)(int));
+#endif
 
   int parseMessage();
   String messageTopic() const;
@@ -96,6 +105,7 @@ class MqttClient : public Client {
 
   void setKeepAliveInterval(unsigned long interval);
   void setConnectionTimeout(unsigned long timeout);
+  void setTxPayloadSize(unsigned short size);
 
   int connectError() const;
   int subscribeQoS() const;
@@ -133,7 +143,11 @@ class MqttClient : public Client {
 private:
   Client* _client;
 
+#ifdef MQTT_CLIENT_STD_FUNCTION_CALLBACK
+  MessageCallback _onMessage;
+#else
   void (*_onMessage)(int);
+#endif
 
   String _id;
   String _username;
@@ -142,6 +156,7 @@ class MqttClient : public Client {
 
   unsigned long _keepAliveInterval;
   unsigned long _connectionTimeout;
+  unsigned short _tx_payload_buffer_size;
 
   int _connectError;
   bool _connected;
