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

Add SSID scan and validation #377

Merged
merged 11 commits into from
Nov 30, 2022
Merged

Add SSID scan and validation #377

merged 11 commits into from
Nov 30, 2022

Conversation

brentru
Copy link
Member

@brentru brentru commented Nov 29, 2022

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.

@brentru brentru requested a review from makermelissa November 29, 2022 20:31
Copy link
Collaborator

@makermelissa makermelissa left a 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?

src/network_interfaces/Wippersnapper_AIRLIFT.h Outdated Show resolved Hide resolved
Comment on lines 132 to 137
// 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;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same thing here.

src/network_interfaces/Wippersnapper_ESP32.h Outdated Show resolved Hide resolved
src/network_interfaces/Wippersnapper_ESP8266.h Outdated Show resolved Hide resolved
@brentru
Copy link
Member Author

brentru commented Nov 30, 2022

@makermelissa

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?

I'm not sure because each network interface includes its own board-specific implementation/API of the WiFi class

@makermelissa
Copy link
Collaborator

@makermelissa

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?

I'm not sure because each network interface includes its own board-specific implementation/API of the WiFi class

Fair enough.

Copy link
Collaborator

@makermelissa makermelissa left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks.

@brentru brentru merged commit f7cf15a into adafruit:main Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scan SSID/RSSI before connecting to WiFi
2 participants