From 2d384b9697e6fc66338add8e3cafbcff94a0f656 Mon Sep 17 00:00:00 2001 From: jerryneedell Date: Sat, 6 Jan 2018 17:52:40 -0500 Subject: [PATCH] Update Adafruit_MQTT_Client.cpp to remove use of min() see https://github.com/adafruit/Adafruit_MQTT_Library/issues/106 for discussion of link failures after upgrading esp8266 community library BSP to version 2.4.0 -- removing the use of min() allows for successful compilation,link and execution. Replace call to min() with ternary statement to accomplish same action. --- Adafruit_MQTT_Client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Adafruit_MQTT_Client.cpp b/Adafruit_MQTT_Client.cpp index de15a53..e2ecc82 100644 --- a/Adafruit_MQTT_Client.cpp +++ b/Adafruit_MQTT_Client.cpp @@ -81,7 +81,7 @@ bool Adafruit_MQTT_Client::sendPacket(uint8_t *buffer, uint16_t len) { if (client->connected()) { // send 250 bytes at most at a time, can adjust this later based on Client - uint16_t sendlen = min(len, (uint16_t)250); + uint16_t sendlen = len > 250 ? 250 : len; //Serial.print("Sending: "); Serial.println(sendlen); ret = client->write(buffer, sendlen); DEBUG_PRINT(F("Client sendPacket returned: ")); DEBUG_PRINTLN(ret);