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

Support setting channel for SoftAP #2695

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions libraries/WiFi/src/WiFiClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,23 +160,26 @@ uint8_t WiFiClass::beginAP(const char *ssid) {
}

uint8_t WiFiClass::beginAP(const char *ssid, uint8_t channel) {
(void) channel;
return beginAP(ssid, nullptr);
return beginAP(ssid, nullptr, channel);
}

uint8_t WiFiClass::beginAP(const char *ssid, const char* passphrase, uint8_t channel) {
(void) channel;
return beginAP(ssid, passphrase);
uint8_t WiFiClass::beginAP(const char *ssid, const char* passphrase) {
return beginAP(ssid, passphrase, 0);
}

uint8_t WiFiClass::beginAP(const char *ssid, const char* passphrase) {
uint8_t WiFiClass::beginAP(const char *ssid, const char* passphrase, uint8_t channel) {
end();

_ssid = ssid;
_password = passphrase;
_wifi.setAP();
_wifi.setSSID(_ssid.c_str());
_wifi.setPassword(passphrase);
#if defined(PICO_CYW43_SUPPORTED)
if (channel > 0) {
cyw43_wifi_ap_set_channel(&cyw43_state, channel);
}
#endif
_wifi.setTimeout(_timeout);
_apMode = true;
IPAddress gw = _wifi.gatewayIP();
Expand Down
Loading