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

[system] Fix bad int to bool conversion for clearCredentials #2736

Merged
merged 1 commit into from Feb 12, 2024

Conversation

eberseth
Copy link
Contributor

@eberseth eberseth commented Feb 9, 2024

Problem

It was reported that WiFi.clearCredentials() was returning a bad value for success in this Community post WiFi.clearCredentials() fails? on p2 @ 5.4.1.

Rick dug into the issue and saw that there was an integer to bool conversion gone bad.

Solution

Added a comparison to zero with the int clearConfiguration() call so that int() == 0 results in a boolean true in network_clear_credentials().

Added comments for network_clear_credentials() usage.

Steps to Test

Run this while credentials are set on the device.

if(!WiFi.clearCredentials()) {
    Log.warn("clear credentials failed!");
}

References

Links to the Community, Docs, Other Issues, etc..


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)

@eberseth eberseth added the 5.x label Feb 9, 2024
@eberseth eberseth added this to the 5.8.0 milestone Feb 9, 2024
@eberseth eberseth added the 6.x label Feb 9, 2024
system/inc/system_network.h Outdated Show resolved Hide resolved
system/src/system_network_manager_api.cpp Show resolved Hide resolved
@eberseth eberseth force-pushed the fix/sc120725/clear-credentials-return-type branch from e85e59a to 8a1bb52 Compare February 10, 2024 01:56
@eberseth
Copy link
Contributor Author

@technobly yea/nay?

@technobly technobly self-requested a review February 12, 2024 22:52
@eberseth eberseth merged commit 8741817 into develop Feb 12, 2024
13 checks passed
@eberseth eberseth deleted the fix/sc120725/clear-credentials-return-type branch February 12, 2024 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants