Skip to content

Commit d712568

Browse files
author
Veijo Pesonen
committed
ESP8266: with empty packet send returns zero if TCP, unsupported otherwise
1 parent daefce6 commit d712568

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

components/wifi/esp8266-driver/ESP8266Interface.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,11 @@ int ESP8266Interface::socket_send(void *handle, const void *data, unsigned size)
568568
return NSAPI_ERROR_NO_SOCKET;
569569
}
570570

571+
if (!size) {
572+
// Firmware limitation
573+
return socket->proto == NSAPI_TCP ? 0 : NSAPI_ERROR_UNSUPPORTED;
574+
}
575+
571576
unsigned long int sendStartTime = rtos::Kernel::get_ms_count();
572577
do {
573578
status = _esp.send(socket->id, data, size);

0 commit comments

Comments
 (0)