Skip to content

Commit 814d936

Browse files
committed
WiFi: allow status() to be called before begin()
1 parent 63a748f commit 814d936

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libraries/SocketWrapper/WiFi.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ class WiFiClass : public NetworkInterface {
7979
return true;
8080
}
8181

82-
int status() {
82+
int status() {
83+
sta_iface = net_if_get_wifi_sta();
84+
netif = sta_iface;
8385
if (net_mgmt(NET_REQUEST_WIFI_IFACE_STATUS, netif, &sta_state,
84-
sizeof(struct wifi_iface_status))) {
86+
sizeof(struct wifi_iface_status))) {
8587
return WL_NO_SHIELD;
8688
}
8789

0 commit comments

Comments
 (0)