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:
commit
6eac8df10f
@ -530,13 +530,11 @@ static int _esp_wifi_send(netdev_t *netdev, const iolist_t *iolist)
|
|||||||
#if ENABLE_DEBUG
|
#if ENABLE_DEBUG
|
||||||
ESP_WIFI_DEBUG("send %d byte", dev->tx_len);
|
ESP_WIFI_DEBUG("send %d byte", dev->tx_len);
|
||||||
#if MODULE_OD && ENABLE_DEBUG_HEXDUMP
|
#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 /* MODULE_OD && ENABLE_DEBUG_HEXDUMP */
|
||||||
#endif
|
#endif
|
||||||
critical_exit();
|
critical_exit();
|
||||||
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
/* send the the packet to the peer(s) mac address */
|
/* 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) {
|
if (esp_wifi_internal_tx(ESP_IF_WIFI_STA, dev->tx_buf, dev->tx_len) == ESP_OK) {
|
||||||
#ifdef MCU_ESP32
|
#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;
|
_esp_wifi_send_is_in = false;
|
||||||
netdev->event_callback(netdev, NETDEV_EVENT_TX_COMPLETE);
|
netdev->event_callback(netdev, NETDEV_EVENT_TX_COMPLETE);
|
||||||
#endif
|
#endif
|
||||||
|
return dev->tx_len;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_esp_wifi_send_is_in = false;
|
_esp_wifi_send_is_in = false;
|
||||||
ESP_WIFI_DEBUG("sending WiFi packet failed");
|
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)
|
static int _esp_wifi_recv(netdev_t *netdev, void *buf, size_t len, void *info)
|
||||||
|
Loading…
Reference in New Issue
Block a user