API Reference / PersWiFiManager::onAp
Attach a handler function that runs every time AP mode is startedSignatures
void onAp(WiFiChangeHandlerFunction fn)
Args
WiFiChangeHandlerFunction fn
A generic function pointer to an AP mode handler function
Notes
This will run the handler function every time AP mode is started, when WiFi fails to connect or AP mode is manually triggered.
For successful connection handler, see onConnect
Example Code
void setup(){
...
//uses a lambda function as the argument
persWM.onAp([]() {
//this code runs every time AP mode is started
DEBUG_PRINT("AP MODE");
DEBUG_PRINT(persWM.getApSsid());
});