Skip to content
This repository was archived by the owner on Jul 9, 2024. It is now read-only.

Commit 6f2abf9

Browse files
committed
Fix libs
1 parent 9f0a703 commit 6f2abf9

23 files changed

+38
-510
lines changed

libraries/WiFi/examples/WiFiProv/README.md

Lines changed: 0 additions & 126 deletions
This file was deleted.

libraries/WiFi/examples/WiFiProv/WiFiProv.ino

Lines changed: 0 additions & 63 deletions
This file was deleted.

libraries/WiFi/src/WiFi.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@
3737
#include "WiFiClient.h"
3838
#include "WiFiServer.h"
3939
#include "WiFiUdp.h"
40-
#include "WiFiProv.h"
4140

42-
class WiFiClass : public WiFiGenericClass, public WiFiSTAClass, public WiFiScanClass, public WiFiAPClass, public WiFiProvClass
41+
class WiFiClass : public WiFiGenericClass, public WiFiSTAClass, public WiFiScanClass, public WiFiAPClass
4342
{
4443
public:
4544
using WiFiGenericClass::channel;
@@ -55,7 +54,8 @@ class WiFiClass : public WiFiGenericClass, public WiFiSTAClass, public WiFiScanC
5554
using WiFiScanClass::BSSID;
5655
using WiFiScanClass::BSSIDstr;
5756
using WiFiScanClass::channel;
58-
public:
57+
58+
public:
5959
void printDiag(Print& dest);
6060
friend class WiFiClient;
6161
friend class WiFiServer;

libraries/WiFi/src/WiFiClient.cpp

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -495,28 +495,23 @@ uint8_t WiFiClient::connected()
495495
int res = recv(fd(), &dummy, 0, MSG_DONTWAIT);
496496
// avoid unused var warning by gcc
497497
(void)res;
498-
// recv only sets errno if res is <= 0
499-
if (res <= 0){
500-
switch (errno) {
501-
case EWOULDBLOCK:
502-
case ENOENT: //caused by vfs
503-
_connected = true;
504-
break;
505-
case ENOTCONN:
506-
case EPIPE:
507-
case ECONNRESET:
508-
case ECONNREFUSED:
509-
case ECONNABORTED:
510-
_connected = false;
511-
log_d("Disconnected: RES: %d, ERR: %d", res, errno);
512-
break;
513-
default:
514-
log_i("Unexpected: RES: %d, ERR: %d", res, errno);
515-
_connected = true;
516-
break;
517-
}
518-
} else {
519-
_connected = true;
498+
switch (errno) {
499+
case EWOULDBLOCK:
500+
case ENOENT: //caused by vfs
501+
_connected = true;
502+
break;
503+
case ENOTCONN:
504+
case EPIPE:
505+
case ECONNRESET:
506+
case ECONNREFUSED:
507+
case ECONNABORTED:
508+
_connected = false;
509+
log_d("Disconnected: RES: %d, ERR: %d", res, errno);
510+
break;
511+
default:
512+
log_i("Unexpected: RES: %d, ERR: %d", res, errno);
513+
_connected = true;
514+
break;
520515
}
521516
}
522517
return _connected;

0 commit comments

Comments
 (0)