diff --git a/cpu/esp8266/esp-wifi/esp_wifi_netdev.c b/cpu/esp8266/esp-wifi/esp_wifi_netdev.c index ff03b8c363..2d26ab2c60 100644 --- a/cpu/esp8266/esp-wifi/esp_wifi_netdev.c +++ b/cpu/esp8266/esp-wifi/esp_wifi_netdev.c @@ -530,13 +530,11 @@ static int _esp_wifi_send(netdev_t *netdev, const iolist_t *iolist) #if ENABLE_DEBUG ESP_WIFI_DEBUG("send %d byte", dev->tx_len); #if MODULE_OD && ENABLE_DEBUG_HEXDUMP - od_hex_dump(dev->tx_buf, dev->tx_le, OD_WIDTH_DEFAULT); + od_hex_dump(dev->tx_buf, dev->tx_len, OD_WIDTH_DEFAULT); #endif /* MODULE_OD && ENABLE_DEBUG_HEXDUMP */ #endif critical_exit(); - int ret = 0; - /* send the the packet to the peer(s) mac address */ if (esp_wifi_internal_tx(ESP_IF_WIFI_STA, dev->tx_buf, dev->tx_len) == ESP_OK) { #ifdef MCU_ESP32 @@ -544,14 +542,13 @@ static int _esp_wifi_send(netdev_t *netdev, const iolist_t *iolist) _esp_wifi_send_is_in = false; netdev->event_callback(netdev, NETDEV_EVENT_TX_COMPLETE); #endif + return dev->tx_len; } else { _esp_wifi_send_is_in = false; ESP_WIFI_DEBUG("sending WiFi packet failed"); - ret = -EIO; + return -EIO; } - - return ret; } static int _esp_wifi_recv(netdev_t *netdev, void *buf, size_t len, void *info)