Could we get equivalent functions as the ESP8266 has for WiFi events:
WiFiEventHandler onStationModeConnected(std::function<void(const WiFiEventStationModeConnected&)>);
WiFiEventHandler onStationModeDisconnected(std::function<void(const WiFiEventStationModeDisconnected&)>);
WiFiEventHandler onStationModeAuthModeChanged(std::function<void(const WiFiEventStationModeAuthModeChanged&)>);
WiFiEventHandler onStationModeGotIP(std::function<void(const WiFiEventStationModeGotIP&)>);
WiFiEventHandler onStationModeDHCPTimeout(std::function<void(void)>);
WiFiEventHandler onSoftAPModeStationConnected(std::function<void(const WiFiEventSoftAPModeStationConnected&)>);
WiFiEventHandler onSoftAPModeStationDisconnected(std::function<void(const WiFiEventSoftAPModeStationDisconnected&)>);
These functions allow using std::function, which allows handling events in class functions cleanly.
I would second this. :)
Any progress on this? Thinking of implementing.
Yes I third this, not only for functionality but also for easy porting of ESP8266 projects over to ESP32 馃憤
Any update on this ?
Think this now supported with #1366.
See this for example: https://github.com/timpur/arduino-esp32/blob/d72e8137b3933470bfa8292e801389064fd8d001/libraries/WiFi/examples/WiFiClientEvents/WiFiClientEvents.ino#L78
@timpur This probably would not solve the portability of ESP8266 projects @tripflex mentioned as there's not separate functions for each event but at least I find this new approach much more versatile and clean.
I need too
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This stale issue has been automatically closed. Thank you for your contributions.
Most helpful comment
Think this now supported with #1366.
See this for example: https://github.com/timpur/arduino-esp32/blob/d72e8137b3933470bfa8292e801389064fd8d001/libraries/WiFi/examples/WiFiClientEvents/WiFiClientEvents.ino#L78