1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #12986 from gschorcht/cpu/esp8266/esp_wifi/fix_send

cpu/esp8266: fix of esp_wifi_send function
This commit is contained in:
benpicco 2019-12-20 00:54:23 +01:00 committed by GitHub
commit 6eac8df10f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)