I need to use the callback function from a class.
For testing a wrote the following lines
class Test {
public:
Test();
void WiFiEvent(WiFiEvent_t event);
};
Test::Test() {
WiFi.onEvent(WiFiEvent);
}
void Test::WiFiEvent(WiFiEvent_t event) {
Serial.printf("[WiFi-event] event: %d\n", event);
}
this results in "error: invalid use of non-static member function"
when I declare it as static, I receive an other error
static void WiFiEvent(WiFiEvent_t event);
what can I do?
many thanks