Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Added 2 new functions for better new and forget WiFi Handling #150

Merged
merged 2 commits into from
Sep 4, 2022

Conversation

marcolino7
Copy link
Contributor

@marcolino7 marcolino7 commented Mar 1, 2022

In order to have better handling of device when a wifi will be forgot and when a new WiFi will be configured I added 2 new function to WiFiManager.
One is

void forgetWiFiFunctionCallback( std::function<void()> func );

and it will be called when a Forget WiFi procedure is completed. Other one is:

void newWiFiFunctionCallback( std::function<void()> func );

and it will be called when new WiFi procedure is completed.
This permit better handling on device where I need to change behaviour of the hardware if on device wifi is configured or not.

Example:

void forgetWifiCallBack();
void newWifiCallBack();

void setup()
{
    WiFiManager.begin(configManager.data.projectName);
    WiFiManager.forgetWiFiFunctionCallback(forgetWifiCallBack);
    WiFiManager.newWiFiFunctionCallback(newWifiCallBack);
}

void forgetWifiCallBack(){
    Serial.println("My Forget Wifi CallBack");
}

void newWifiCallBack(){
    Serial.println("My New Wifi CallBack");
}

Documentation also updated.

@maakbaas maakbaas merged commit 57c54db into maakbaas:master Sep 4, 2022
@maakbaas
Copy link
Owner

maakbaas commented Sep 4, 2022

Better late than never: Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants