examples/ethernet/eth2ap/main/ethernet_example_main.c
static void wifi_event_handler(void *arg, esp_event_base_t event_base,
                               int32_t event_id, void *event_data)
{
    switch (event_id) {
    case WIFI_EVENT_AP_STACONNECTED:
        ESP_LOGI(TAG, "Wi-Fi AP got a station connected");
        s_sta_is_connected = true;
        esp_wifi_internal_reg_rxcb(ESP_IF_WIFI_AP, pkt_wifi2eth);
        break;
    case WIFI_EVENT_AP_STADISCONNECTED:
        ESP_LOGI(TAG, "Wi-Fi AP got a station disconnected");
        s_sta_is_connected = false;
        esp_wifi_internal_reg_rxcb(ESP_IF_WIFI_AP, NULL);
        break;
    default:
        break;
    }
}
// Event handler for Wi-Fi
Event handler for Wi-Fi
Event handler for Wi - Fi
static void wifi_event_handler(void *arg, esp_event_base_t event_base,
                               int32_t event_id, void *event_data)
{
    switch (event_id) {
    case WIFI_EVENT_AP_STACONNECTED:
        ESP_LOGI(TAG, "Wi-Fi AP got a station connected");
        s_sta_is_connected = true;
        esp_wifi_internal_reg_rxcb(ESP_IF_WIFI_AP, pkt_wifi2eth);
        break;
    case WIFI_EVENT_AP_STADISCONNECTED:
        ESP_LOGI(TAG, "Wi-Fi AP got a station disconnected");
        s_sta_is_connected = false;
        esp_wifi_internal_reg_rxcb(ESP_IF_WIFI_AP, NULL);
        break;
    default:
        break;
    }
}
static void wifi_event_handler ( void * arg , esp_event_base_t event_base , int32_t event_id , void * event_data ) { switch ( event_id ) { case WIFI_EVENT_AP_STACONNECTED : ESP_LOGI ( TAG , " " ) ; s_sta_is_connected = true ; esp_wifi_internal_reg_rxcb ( ESP_IF_WIFI_AP , pkt_wifi2eth ) ; break ; case WIFI_EVENT_AP_STADISCONNECTED : ESP_LOGI ( TAG , " " ) ; s_sta_is_connected = false ; esp_wifi_internal_reg_rxcb ( ESP_IF_WIFI_AP , NULL ) ; break ; default : break ; } }
Event handler for Wi-Fi
Event handler for Wi - Fi