Register an event handler to a specific loop (legacy). This function behaves in the same manner as esp_event_handler_register, except the additional specification of the event loop to register the handler to.
the event loop to register this handler function to, must not be NULL
event_base
the base ID of the event to register the handler for
event_id
the ID of the event to register the handler for
event_handler
the handler function which gets called when the event is dispatched
event_handler_arg
data, aside from event data, that is passed to the handler when it is called
Return value
- ESP_OK: Success - ESP_ERR_NO_MEM: Cannot allocate memory for the handler - ESP_ERR_INVALID_ARG: Invalid combination of event base and event ID - Others: Fail
Notes
the event loop library does not maintain a copy of event_handler_arg, therefore the user should ensure that event_handler_arg still points to a valid location by the time the handler gets called
Examples
esp_event_handler_register_with() is referenced by 1 libraries and example projects: