From 3e2e0749382c69cd891973b24f656bc473219152 Mon Sep 17 00:00:00 2001 From: Rajkumar Kanagaraj Date: Wed, 17 Jun 2020 17:55:41 +0100 Subject: [PATCH] Fix esp8266 driver compilation warning --- components/wifi/esp8266-driver/ESP8266/ESP8266.cpp | 5 ++--- components/wifi/esp8266-driver/ESP8266/ESP8266.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/wifi/esp8266-driver/ESP8266/ESP8266.cpp b/components/wifi/esp8266-driver/ESP8266/ESP8266.cpp index b4b1d81283..2de83a6b33 100644 --- a/components/wifi/esp8266-driver/ESP8266/ESP8266.cpp +++ b/components/wifi/esp8266-driver/ESP8266/ESP8266.cpp @@ -414,7 +414,7 @@ const char *ESP8266::ip_addr(void) return _ip_buffer; } -const bool ESP8266::set_ip_addr(const char *ip, const char *gateway, const char *netmask) +bool ESP8266::set_ip_addr(const char *ip, const char *gateway, const char *netmask) { if (ip == nullptr || ip[0] == '\0') { return false; @@ -708,7 +708,6 @@ nsapi_size_or_error_t ESP8266::send(int id, const void *data, uint32_t amount) nsapi_error_t ret = NSAPI_ERROR_DEVICE_ERROR; int bytes_confirmed = 0; - constexpr unsigned int send_ack_retries = 3; // +CIPSEND supports up to 2048 bytes at a time // Data stream can be truncated @@ -759,7 +758,7 @@ nsapi_size_or_error_t ESP8266::send(int id, const void *data, uint32_t amount) } else if (_sock_i[id].proto == NSAPI_UDP) { ret = NSAPI_ERROR_NO_MEMORY; } - } else if (bytes_confirmed != amount && _sock_i[id].proto == NSAPI_UDP) { + } else if (bytes_confirmed != (int)amount && _sock_i[id].proto == NSAPI_UDP) { tr_debug("send(): Error: confirmed %d bytes, but expected %d.", bytes_confirmed, amount); ret = NSAPI_ERROR_DEVICE_ERROR; } else { diff --git a/components/wifi/esp8266-driver/ESP8266/ESP8266.h b/components/wifi/esp8266-driver/ESP8266/ESP8266.h index c4a808b858..164c877bde 100644 --- a/components/wifi/esp8266-driver/ESP8266/ESP8266.h +++ b/components/wifi/esp8266-driver/ESP8266/ESP8266.h @@ -206,7 +206,7 @@ public: * * @return true if operation was successful and flase otherwise */ - const bool set_ip_addr(const char *ip, const char *gateway, const char *netmask); + bool set_ip_addr(const char *ip, const char *gateway, const char *netmask); /** * Get the MAC address of ESP8266