Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix WiFi credentials clear event not being fired #1580

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

garzdin
Copy link

@garzdin garzdin commented Oct 9, 2018

Problem

A WiFi credentials event should be fired when a user calls WiFi.clear_credentials(). It doesn't currently happen.

Solution

A system event is triggered, when a user clears WiFi credentials.

Example App

void credentialsChanged() {
    Serial.println("Credentials changed");
}

SYSTEM_MODE(AUTOMATIC);

void setup() {
    Serial.begin(9600);
    System.on(network_credentials, credentialsChanged);
}

void loop() {
    Serial.println("Clearing credentials");
    WiFi.clearCredentials();
    delay(1000);
}

References

#1570


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@@ -184,6 +184,8 @@ class WiFiNetworkInterface : public ManagedIPNetworkInterface<WLanConfig, WiFiNe

bool clear_credentials() override
{
system_notify_event(network_credentials, network_credentials_cleared);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel I would like to make this conditional on the result of wlan_clear_credentials. We should also check if other Radio interfaces need a similar change. It might be better to add it to the network_clear_credentials() function so that it is ubiquitous?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants