mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #21] Callback when in AP mode #18
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @alwynallan on GitHub (Dec 16, 2015).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/21
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:
void setAPCallback( void (*func)(void) );and private:
void (*_apcallback)(void) = NULL;Then in WiFiManger.cpp after
WiFi.mode(WIFI_AP);I addedif( _apcallback != NULL) _apcallback();and the obvious
void WiFiManager::setAPCallback( void (*func)(void) ) {_apcallback = func;}Feel free to improve. Thanks for the handy library.
@domonetic commented on GitHub (Dec 16, 2015):
+1
@tzapu commented on GitHub (Dec 16, 2015):
Hi,
this is very nice, i will add it.
something like this i plan to also add for additional variables, thank you very much, you hva kickstarted me in the right direction.
cheers
alex
@tzapu commented on GitHub (Dec 16, 2015):
I will also try to add a display/oled example for this, maybe i ll mange tomorrow
thank again
@tzapu commented on GitHub (Dec 16, 2015):
probably worth sending the ip of the AP in the call back as well
@domonetic commented on GitHub (Dec 16, 2015):
I think it would overload of unnecessary code, there are functions to find the ip.
@tablatronix commented on GitHub (Dec 16, 2015):
Got a pull request or commit ? I was about to do this myself.
@tzapu commented on GitHub (Dec 17, 2015):
@domonetic you are right, makes sense
@tablatronix i plan on merging it today, as soon as i get a chance. will update here
@tzapu commented on GitHub (Dec 17, 2015):
guys, pushed an update, will update documentation as well later
thanks again
@tzapu commented on GitHub (Dec 28, 2015):
this is done and seems to work fine
thanks guys
@alwynallan commented on GitHub (Dec 28, 2015):
Thanks guys for including this. I have upgraded to your version and it all works. One day I'll learn git fork/merge and make my changes myself.