Skip to content

Commit d3d7cad

Browse files
committedJan 11, 2024
fix soft ap start error check
mbed os doesn't allow to use password with length lower than 8 character or higher then 64, when a password < 8 char is provided it returns an error this error was not managed. with this patch the error is handled and retur imediatly.
1 parent ff3334d commit d3d7cad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

Diff for: ‎libraries/WiFi/src/WiFi.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ int arduino::WiFiClass::beginAP(const char* ssid, const char* passphrase, uint8_
6161
//Set ap ssid, password and channel
6262
softAPInterface->set_network(_ip, _netmask, _gateway);
6363
nsapi_error_t result = softAPInterface->start(ssid, passphrase, NSAPI_SECURITY_WPA2, channel, true /* dhcp server */, NULL, true /* cohexistance */);
64+
if (result != NSAPI_ERROR_OK) {
65+
_currentNetworkStatus = WL_AP_FAILED;
66+
return _currentNetworkStatus;
67+
}
6468

6569
nsapi_error_t registrationResult;
6670
softAPInterface->unregister_event_handler();

0 commit comments

Comments
 (0)
Please sign in to comment.