From be7871677ff6bffb257aba6151425152eddc6871 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Thu, 19 Jan 2017 02:03:37 +0200 Subject: [PATCH] Update WiFiUdp.cpp Change return value of UDP::endPacket() to match specifications Ref: https://github.com/espressif/arduino-esp32/issues/138 --- libraries/WiFi/src/WiFiUdp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/WiFi/src/WiFiUdp.cpp b/libraries/WiFi/src/WiFiUdp.cpp index 1afd4914..cb91923a 100644 --- a/libraries/WiFi/src/WiFiUdp.cpp +++ b/libraries/WiFi/src/WiFiUdp.cpp @@ -158,8 +158,9 @@ int WiFiUDP::endPacket(){ int sent = sendto(udp_server, tx_buffer, tx_buffer_len, 0, (struct sockaddr*) &recipient, sizeof(recipient)); if(sent < 0){ log_e("could not send data: %d", errno); + return 0; } - return sent; + return 1; } size_t WiFiUDP::write(uint8_t data){