Skip to content

Commit 585df8b

Browse files
committed
Implement disconnect function
1 parent c1bbcc4 commit 585df8b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libraries/WiFi/src/WiFi.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,14 @@ void arduino::WiFiClass::ensureDefaultAPNetworkConfiguration() {
7777
}
7878

7979
void arduino::WiFiClass::end() {
80+
disconnect();
81+
}
82+
83+
int arduino::WiFiClass::disconnect() {
8084
if (softap != NULL) {
81-
((WhdSoftAPInterface*)softap)->stop();
85+
return static_cast<WhdSoftAPInterface*>(softap)->stop();
86+
} else {
87+
return wifi_if->disconnect();
8288
}
8389
}
8490

0 commit comments

Comments
 (0)