examples/ethernet/eth2ap/main/ethernet_example_main.c
static esp_err_t pkt_eth2wifi(esp_eth_handle_t eth_handle, uint8_t *buffer, uint32_t len)
{
    esp_err_t ret = ESP_OK;
    flow_control_msg_t msg = {
        .packet = buffer,
        .length = len
    };
    if (xQueueSend(flow_control_queue, &msg, pdMS_TO_TICKS(FLOW_CONTROL_QUEUE_TIMEOUT_MS)) != pdTRUE) {
        ESP_LOGE(TAG, "send flow control message failed or timeout");
        free(buffer);
        ret = ESP_FAIL;
    }
    return ret;
}
// Forward packets from Ethernet to Wi-Fi
// Note that, Ethernet works faster than Wi-Fi on ESP32,
// so we need to add an extra queue to balance their speed difference.
Forward packets from Ethernet to Wi-Fi
Note that, Ethernet works faster than Wi-Fi on ESP32,
so we need to add an extra queue to balance their speed difference.
Forward packets from Ethernet to Wi - Fi Note that Ethernet works faster than Wi - Fi on ESP32 so we need to add an extra queue to balance their speed difference .
static esp_err_t pkt_eth2wifi(esp_eth_handle_t eth_handle, uint8_t *buffer, uint32_t len)
{
    esp_err_t ret = ESP_OK;
    flow_control_msg_t msg = {
        .packet = buffer,
        .length = len
    };
    if (xQueueSend(flow_control_queue, &msg, pdMS_TO_TICKS(FLOW_CONTROL_QUEUE_TIMEOUT_MS)) != pdTRUE) {
        ESP_LOGE(TAG, "send flow control message failed or timeout");
        free(buffer);
        ret = ESP_FAIL;
    }
    return ret;
}
static esp_err_t pkt_eth2wifi ( esp_eth_handle_t eth_handle , uint8_t * buffer , uint32_t len ) { esp_err_t ret = ESP_OK ; flow_control_msg_t msg = { . packet = buffer , . length = len } ; if ( xQueueSend ( flow_control_queue , & msg , pdMS_TO_TICKS ( FLOW_CONTROL_QUEUE_TIMEOUT_MS ) ) != pdTRUE ) { ESP_LOGE ( TAG , " " ) ; free ( buffer ) ; ret = ESP_FAIL ; } return ret ; }
Forward packets from Ethernet to Wi-Fi
Note that, Ethernet works faster than Wi-Fi on ESP32,
so we need to add an extra queue to balance their speed difference.
Forward packets from Ethernet to Wi - Fi Note that Ethernet works faster than Wi - Fi on ESP32 so we need to add an extra queue to balance their speed difference .