Skip to content

Commit d4afbb1

Browse files
authored
Merge pull request #826 from Rocketct/fix_wifi_AP_pass
Fix soft ap start error check
2 parents 5af0bd7 + d3d7cad commit d4afbb1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/WiFi/src/WiFi.cpp

+4
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)