{"action":"closed","issue":{"url":"https://api.github.com/repos/tzapu/WiFiManager/issues/21","labels_url":"https://api.github.com/repos/tzapu/WiFiManager/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/tzapu/WiFiManager/issues/21/comments","events_url":"https://api.github.com/repos/tzapu/WiFiManager/issues/21/events","html_url":"https://github.com/tzapu/WiFiManager/issues/21","id":122563012,"number":21,"title":"Callback when in AP mode","user":{"login":"alwynallan","id":10135244,"avatar_url":"https://avatars.githubusercontent.com/u/10135244?v=3","gravatar_id":"","url":"https://api.github.com/users/alwynallan","html_url":"https://github.com/alwynallan","followers_url":"https://api.github.com/users/alwynallan/followers","following_url":"https://api.github.com/users/alwynallan/following{/other_user}","gists_url":"https://api.github.com/users/alwynallan/gists{/gist_id}","starred_url":"https://api.github.com/users/alwynallan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alwynallan/subscriptions","organizations_url":"https://api.github.com/users/alwynallan/orgs","repos_url":"https://api.github.com/users/alwynallan/repos","events_url":"https://api.github.com/users/alwynallan/events{/privacy}","received_events_url":"https://api.github.com/users/alwynallan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-12-16T17:40:50Z","updated_at":"2015-12-28T13:35:59Z","closed_at":"2015-12-28T13:35:59Z","body":"Others might have this need, so feel free to integrate my solution. My application has a display but no user input. It's useful to display that the device is in AP mode, waiting for configuration. I did it with a callback function: in WiFiManager.h, public:\r\n\r\n`void    setAPCallback( void (*func)(void) );`\r\n\r\nand private:\r\n\r\n`void (*_apcallback)(void) = NULL;`\r\n\r\nThen in WiFiManger.cpp after `WiFi.mode(WIFI_AP);` I added\r\n\r\n`if( _apcallback != NULL) _apcallback();`\r\n\r\nand the obvious\r\n\r\n`void WiFiManager::setAPCallback( void (*func)(void) ) {`\r\n`  _apcallback = func;`\r\n`}`\r\n\r\nFeel free to improve. Thanks for the handy library."}}