C++ event handler functions as member functions
Posted: Sun Jul 07, 2024 10:17 am
by teodor12
Is there any other way to register event handler functions in WifiHandler class? I do not want to make them static. I attached the files of the my component.
Thank you!
Re: C++ event handler functions as member functions
Posted: Mon Jul 08, 2024 9:02 am
by MicroController
Use a static 'adapter' function and the user-provided void* argument of the event callback to route the callback to a non-static member function like e.g. here:
https://esp32.com/viewtopic.php?f=13&t=40146#p132955