Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between esp_event_handler_instance_[un]register*() and esp_event_handler_[un]register*() not very clear in documentation (IDFGH-11711) #12818

Closed
3 tasks done
hl037 opened this issue Dec 17, 2023 · 2 comments
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally

Comments

@hl037
Copy link

hl037 commented Dec 17, 2023

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Maybe it should be explicitly stated that esp_event_handler_instance_[un]register*() does the same thing as esp_event_handler_[un]register*(), but a same same handler to the same event return yet another instance instead of replacing the previous one.

Also, I'm wondering why would one register twice the same handler to the same event ? Except if it is to pass a different argument. If that is so (That is what I think, but I had to check the sources to get to it), then that should also be documented.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Dec 17, 2023
@github-actions github-actions bot changed the title Difference between esp_event_handler_instance_[un]register*() and esp_event_handler_[un]register*() not very clear in documentation Difference between esp_event_handler_instance_[un]register*() and esp_event_handler_[un]register*() not very clear in documentation (IDFGH-11711) Dec 17, 2023
@hl037
Copy link
Author

hl037 commented Dec 17, 2023

There is also this "legacy" thing, which is not very meaningful either: is it deprecated ? Is it because it's in process of refactoring, and later this instance pointer will become the handle ?

@SoucheSouche
Copy link
Collaborator

Hi @hl037,

I think that the meaning of the instance parameter is fairly well defined in esp_event_handler_instance_register and any function in which it appears in general.

I agree that there could be a note added to inform that calling esp_event_handler_instance_register with instance set to NULL is the same as calling esp_event_handler_register.

@SoucheSouche SoucheSouche self-assigned this Dec 19, 2023
@espressif-bot espressif-bot added Status: Selected for Development Issue is selected for development and removed Status: Opened Issue is new labels Dec 20, 2023
@espressif-bot espressif-bot added Status: Opened Issue is new Status: Selected for Development Issue is selected for development Status: Reviewing Issue is being reviewed Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Selected for Development Issue is selected for development Status: Opened Issue is new Status: Reviewing Issue is being reviewed labels Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

3 participants