Closed
Description
I figured out that callbacks of events registered with methods onX... (like onStationModeGotIP) are not executed.
Looking in code, in file ESP8266WiFiGeneric.cpp, method _eventCallback:
For events registered using predefined methods (which have mCanExpire = true), are removed and not executed, because of the next line:
if (handler->canExpire() && handler.unique()) {
But when they are registered using the old way (onEvent(....)), because mCanExpire = false, they are executed.
for(auto it = std::begin(sCbEventList); it != std::end(sCbEventList); ) {
WiFiEventHandler &handler = *it;
if (handler->canExpire() && handler.unique()) {
it = sCbEventList.erase(it);
}
else { /** ELSE SHOULD EXISTS? or (*handler)(event); should be called allways regardless of if (handler->canExpire()... ***/
(*handler)(event);
++it;
}
}
Metadata
Metadata
Assignees
Labels
No labels