Esp IDF examples: does WiFi station_example_main.c need 2 event handler instances?
Posted: Mon Nov 10, 2025 5:18 pm
In esp-idf/examples/wifi/getting_started/station/main/station_example_main.c there are 2 event handler instances defined and used.
Wouldn't it suffice to use only 1 or even none and setting the last argument in the register function to NULL?
Wouldn't it suffice to use only 1 or even none and setting the last argument in the register function to NULL?
Code: Select all
esp_event_handler_instance_t instance_any_id;
esp_event_handler_instance_t instance_got_ip;
ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT,
ESP_EVENT_ANY_ID,
&event_handler,
NULL,
&instance_any_id));
ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT,
IP_EVENT_STA_GOT_IP,
&event_handler,
NULL,
&instance_got_ip));