Skip to content

Commit b60f33e

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

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libraries/SocketWrapper/WiFi.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ class WiFiClass : public NetworkInterface {
8080
}
8181

8282
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)