Skip to content

ESP8266WiFi - document event handler lifetime, add [[nodiscard]] #9087

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

Merged
merged 4 commits into from
Mar 17, 2024

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented Feb 11, 2024

See #9086 (comment) / @srvmgr
resolve #9086

Mention that the object should either be global or static, and that the callback must be called from either setup() or after it is done.
Mark event methods as [[nodiscard]] to add a warning when building without assigning them anywhere

@mcspr mcspr merged commit 2064d43 into esp8266:master Mar 17, 2024
@mcspr mcspr deleted the wifi/event-lifetimes branch March 17, 2024 18:11
hasenradball pushed a commit to hasenradball/Arduino that referenced this pull request Nov 18, 2024
…8266#9087)

* disallow not assigning wifieventhandler somewhere

* fix markdown syntax in rst

* mention lifetime in example and docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Callbacks of WiFi events (onX) are not called
1 participant