examples/ethernet/eth2ap/main/ethernet_example_main.c
static void eth2wifi_flow_control_task(void *args)
{
    flow_control_msg_t msg;
    int res = 0;
    uint32_t timeout = 0;
    while (1) {
        if (xQueueReceive(flow_control_queue, &msg, pdMS_TO_TICKS(FLOW_CONTROL_QUEUE_TIMEOUT_MS)) == pdTRUE) {
            timeout = 0;
            if (s_sta_is_connected && msg.length) {
                do {
                    vTaskDelay(pdMS_TO_TICKS(timeout));
                    timeout += 2;
                    res = esp_wifi_internal_tx(ESP_IF_WIFI_AP, msg.packet, msg.length);
                } while (res && timeout < FLOW_CONTROL_WIFI_SEND_TIMEOUT_MS);
                if (res != ESP_OK) {
                    ESP_LOGE(TAG, "WiFi send packet failed: %d", res);
                }
            }
            free(msg.packet);
        }
    }
    vTaskDelete(NULL);
}
// This task will fetch the packet from the queue, and then send out through Wi-Fi.
// Wi-Fi handles packets slower than Ethernet, we might add some delay between each transmitting.
This task will fetch the packet from the queue, and then send out through Wi-Fi.
Wi-Fi handles packets slower than Ethernet, we might add some delay between each transmitting.
This task will fetch the packet from the queue and then send out through Wi - Fi . Wi - Fi handles packets slower than Ethernet we might add some delay between each transmitting .
static void eth2wifi_flow_control_task(void *args)
{
    flow_control_msg_t msg;
    int res = 0;
    uint32_t timeout = 0;
    while (1) {
        if (xQueueReceive(flow_control_queue, &msg, pdMS_TO_TICKS(FLOW_CONTROL_QUEUE_TIMEOUT_MS)) == pdTRUE) {
            timeout = 0;
            if (s_sta_is_connected && msg.length) {
                do {
                    vTaskDelay(pdMS_TO_TICKS(timeout));
                    timeout += 2;
                    res = esp_wifi_internal_tx(ESP_IF_WIFI_AP, msg.packet, msg.length);
                } while (res && timeout < FLOW_CONTROL_WIFI_SEND_TIMEOUT_MS);
                if (res != ESP_OK) {
                    ESP_LOGE(TAG, "WiFi send packet failed: %d", res);
                }
            }
            free(msg.packet);
        }
    }
    vTaskDelete(NULL);
}
static void eth2wifi_flow_control_task ( void * args ) { flow_control_msg_t msg ; int res = 0 ; uint32_t timeout = 0 ; while ( 1 ) { if ( xQueueReceive ( flow_control_queue , & msg , pdMS_TO_TICKS ( FLOW_CONTROL_QUEUE_TIMEOUT_MS ) ) == pdTRUE ) { timeout = 0 ; if ( s_sta_is_connected && msg . length ) { do { vTaskDelay ( pdMS_TO_TICKS ( timeout ) ) ; timeout += 2 ; res = esp_wifi_internal_tx ( ESP_IF_WIFI_AP , msg . packet , msg . length ) ; } while ( res && timeout < FLOW_CONTROL_WIFI_SEND_TIMEOUT_MS ) ; if ( res != ESP_OK ) { ESP_LOGE ( TAG , " " , res ) ; } } free ( msg . packet ) ; } } vTaskDelete ( NULL ) ; }
This task will fetch the packet from the queue, and then send out through Wi-Fi.
This task will fetch the packet from the queue and then send out through Wi - Fi .