Skip to content

Commit 810aaf9

Browse files
Rocketctmultiplemonomials
authored andcommitted
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 6b6bf4a commit 810aaf9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/WiFi/src/WiFi.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ int arduino::WiFiClass::beginAP(const char* ssid, const char* passphrase, uint8_
6969
//Set ap ssid, password and channel
7070
softAPInterface->set_network(_ip, _netmask, _gateway);
7171
nsapi_error_t result = softAPInterface->start(ssid, passphrase, NSAPI_SECURITY_WPA2, channel, true /* dhcp server */, NULL, true /* cohexistance */);
72+
if (result != NSAPI_ERROR_OK) {
73+
_currentNetworkStatus = WL_AP_FAILED;
74+
return _currentNetworkStatus;
75+
}
7276

7377
nsapi_error_t registrationResult;
7478
softAPInterface->unregister_event_handler();

0 commit comments

Comments
 (0)