Skip to content

Commit 208d703

Browse files
authored
Merge pull request #11338 from cydriftcloud/pr/psoc6-softap-bringdown
Bring down interface when stopping softap
2 parents 9a1ffdd + 5a3562a commit 208d703

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

features/netsocket/emac-drivers/TARGET_WHD/interface/WhdSoftAPInterface.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,19 @@ int WhdSoftAPInterface::stop(void)
173173
return NSAPI_ERROR_DHCP_FAILURE;
174174
}
175175
_dhcp_server.reset();
176-
return whd_wifi_stop_ap(_whd_emac.ifp);
176+
177+
// bring down
178+
int err = _interface->bringdown();
179+
if (err) {
180+
return err;
181+
}
182+
183+
// stop softap
184+
whd_result_t res = whd_wifi_stop_ap(_whd_emac.ifp);
185+
if (res != WHD_SUCCESS) {
186+
return whd_toerror(res);
187+
}
188+
return NSAPI_ERROR_OK;
177189
}
178190

179191
int WhdSoftAPInterface::remove_custom_ie(const whd_custom_ie_info_t *ie_info)

0 commit comments

Comments
 (0)