-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add SSID scan and validation #377
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good. I made some comments, but it looks like a lot of similar code. Would having the code in a base class function and then maybe checking an overridable variable to see if the class has been loaded make it easier to maintain?
// Was the network within secrets.json found? | ||
bool is_ssid_found = false; | ||
for (int i = 0; i < n; ++i) { | ||
if (strcmp(_ssid, WiFi.SSID(i)) == 0) | ||
is_ssid_found = true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here.
I'm not sure because each network interface includes its own board-specific implementation/API of the WiFi class |
Fair enough. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks.
Resolves #328 by adding a function to perform a WiFi scan and check if the user-defined SSID within secrets.json is within the list of scanned SSIDs.