Skip to content

Commit 51446de

Browse files
authored
Merge pull request #13144 from rajkan01/fix_esp_driver_compilation_warnings
Fix esp8266 driver compilation warning
2 parents 847807e + 3e2e074 commit 51446de

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

components/wifi/esp8266-driver/ESP8266/ESP8266.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ const char *ESP8266::ip_addr(void)
414414
return _ip_buffer;
415415
}
416416

417-
const bool ESP8266::set_ip_addr(const char *ip, const char *gateway, const char *netmask)
417+
bool ESP8266::set_ip_addr(const char *ip, const char *gateway, const char *netmask)
418418
{
419419
if (ip == nullptr || ip[0] == '\0') {
420420
return false;
@@ -708,7 +708,6 @@ nsapi_size_or_error_t ESP8266::send(int id, const void *data, uint32_t amount)
708708

709709
nsapi_error_t ret = NSAPI_ERROR_DEVICE_ERROR;
710710
int bytes_confirmed = 0;
711-
constexpr unsigned int send_ack_retries = 3;
712711

713712
// +CIPSEND supports up to 2048 bytes at a time
714713
// Data stream can be truncated
@@ -759,7 +758,7 @@ nsapi_size_or_error_t ESP8266::send(int id, const void *data, uint32_t amount)
759758
} else if (_sock_i[id].proto == NSAPI_UDP) {
760759
ret = NSAPI_ERROR_NO_MEMORY;
761760
}
762-
} else if (bytes_confirmed != amount && _sock_i[id].proto == NSAPI_UDP) {
761+
} else if (bytes_confirmed != (int)amount && _sock_i[id].proto == NSAPI_UDP) {
763762
tr_debug("send(): Error: confirmed %d bytes, but expected %d.", bytes_confirmed, amount);
764763
ret = NSAPI_ERROR_DEVICE_ERROR;
765764
} else {

components/wifi/esp8266-driver/ESP8266/ESP8266.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ class ESP8266 {
206206
*
207207
* @return true if operation was successful and flase otherwise
208208
*/
209-
const bool set_ip_addr(const char *ip, const char *gateway, const char *netmask);
209+
bool set_ip_addr(const char *ip, const char *gateway, const char *netmask);
210210

211211
/**
212212
* Get the MAC address of ESP8266

0 commit comments

Comments
 (0)