1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 14:33:52 +01:00

cpu/esp8266: fix of esp_wifi_send

In case of succes, the esp_wifi_send function returned a 0 instead of sent bytes.
This commit is contained in:
Gunar Schorcht 2019-12-18 21:52:25 +01:00
parent 4f4e7cde16
commit 0194d7f44b

View File

@ -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)