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

validate wifi Access Point channel #8087

Merged
merged 1 commit into from
Jun 20, 2023
Merged

validate wifi Access Point channel #8087

merged 1 commit into from
Jun 20, 2023

Conversation

anecdata
Copy link
Member

Before this PR, a call to start an AP with an invalid channel (not 1-13) would succeed, but the channel would be set to 1, and on espressif, the supplied SSID would be superceded by the default naming, ESP_XXYYZZ.

This PR borrows from the Monitor code and adds the check that the supplied channel is 1-13:

>>> wifi.radio.start_ap(ssid="ssid", password="password", authmode=[wifi.AuthMode.WPA2, wifi.AuthMode.PSK], channel=14)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: channel must be 1-13

Copy link

@bill88t bill88t 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. Also nice branch name.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thank you!

@tannewt tannewt merged commit 4789508 into adafruit:main Jun 20, 2023
@anecdata anecdata deleted the ap_chan branch June 20, 2023 20:27
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.

3 participants