Regression: NetworkEvents::onEvent()
can't register function calbacks via lambda expressions
#10365
Open
1 task done
Labels
Status: Awaiting triage
Issue is waiting for triage
Board
ESP32 Dev module
Device Description
plain module
Hardware Configuration
plain module
Version
latest master (checkout manually)
IDE Name
PlatformIO
Operating System
Ubuntu Linux
Flash frequency
defajult
PSRAM enabled
no
Upload speed
115200
Description
Network lib has a regression when updated from 3.0.4 to 3.0.5
The method NetworkEvents::onEvent
can no longer register two or more functional callbacks for Network event handling when those are lambda expressions.
In 2f89026 additional code was added that tries to check if an attempt is made to register a duplicate callback function based on determined address of a callback
arduino-esp32/libraries/Network/src/NetworkEvents.cpp
Line 218 in 7018cd1
This template code does not work properly for lambdas and returns 0 (nullptr) always.
arduino-esp32/libraries/Network/src/NetworkEvents.cpp
Lines 153 to 160 in 7018cd1
Do we really need that duplicate callbacks check? It's up to user to register callback, even if those are called twice there is no big deal in that. While that address-pointer comparison magic is tend to errors.
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: