Skip to content

Commit d5c8070

Browse files
pennamandreagilardoni
authored andcommitted
WiFi make begin() return status()
1 parent 55934df commit d5c8070

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libraries/SocketWrapper/WiFi.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class WiFiClass: public NetworkInterface
1616
WiFiClass() {}
1717
~WiFiClass() {}
1818

19-
bool begin(const char* ssid, const char* passphrase, wl_enc_type security = ENC_TYPE_UNKNOWN, bool blocking = true) {
19+
int begin(const char* ssid, const char* passphrase, wl_enc_type security = ENC_TYPE_UNKNOWN, bool blocking = true) {
2020
sta_iface = net_if_get_wifi_sta();
2121
netif = sta_iface;
2222
sta_config.ssid = (const uint8_t *)ssid;
@@ -40,10 +40,10 @@ class WiFiClass: public NetworkInterface
4040
net_mgmt_event_wait_on_iface(sta_iface, NET_EVENT_WIFI_CONNECT_RESULT, NULL, NULL, NULL, K_FOREVER);
4141
}
4242

43-
return true;
43+
return status();
4444
}
4545

46-
bool beginAP(char* ssid, char* passphrase, int channel = WIFI_CHANNEL_ANY, bool blocking = true) {
46+
int beginAP(char* ssid, char* passphrase, int channel = WIFI_CHANNEL_ANY, bool blocking = true) {
4747
if (ap_iface != NULL) {
4848
return false;
4949
}
@@ -71,7 +71,7 @@ class WiFiClass: public NetworkInterface
7171
net_mgmt_event_wait_on_iface(ap_iface, NET_EVENT_WIFI_AP_ENABLE_RESULT, NULL, NULL, NULL, K_FOREVER);
7272
}
7373

74-
return true;
74+
return status();
7575
}
7676

7777
int status() {

0 commit comments

Comments
 (0)