esp_event_handler_instance_unregister_with() function
Unregister a handler instance from a specific event loop. Unregisters a handler instance, so it will no longer be called during dispatch. Handler instances can be unregistered for any combination of event_base and event_id which were previously registered. To unregister a handler instance, the event_base and event_id arguments must match exactly the arguments passed to esp_event_handler_instance_register() when that handler instance was registered. Passing ESP_EVENT_ANY_BASE and/or ESP_EVENT_ANY_ID will only unregister handler instances that were registered with the same wildcard arguments.
Arguments
event_loop
the event loop with which to unregister this handler function, must not be NULL
event_base
the base of the event with which to unregister the handler
event_id
the ID of the event with which to unregister the handler
instance
the instance object of the registration to be unregistered
Return value
- ESP_OK: Success - ESP_ERR_INVALID_ARG: Invalid combination of event base and event ID - Others: Fail
Notes
When using ESP_EVENT_ANY_ID, handlers registered to specific event IDs using the same base will not be unregistered. When using ESP_EVENT_ANY_BASE, events registered to specific bases will also not be unregistered. This avoids accidental unregistration of handlers registered by other users or components.