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

Commit

Permalink
Fix libs
Browse files Browse the repository at this point in the history
  • Loading branch information
m4tx committed Aug 17, 2020
1 parent 9f0a703 commit 6f2abf9
Show file tree
Hide file tree
Showing 23 changed files with 38 additions and 510 deletions.
126 changes: 0 additions & 126 deletions libraries/WiFi/examples/WiFiProv/README.md

This file was deleted.

63 changes: 0 additions & 63 deletions libraries/WiFi/examples/WiFiProv/WiFiProv.ino

This file was deleted.

6 changes: 3 additions & 3 deletions libraries/WiFi/src/WiFi.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@
#include "WiFiClient.h"
#include "WiFiServer.h"
#include "WiFiUdp.h"
#include "WiFiProv.h"

class WiFiClass : public WiFiGenericClass, public WiFiSTAClass, public WiFiScanClass, public WiFiAPClass, public WiFiProvClass
class WiFiClass : public WiFiGenericClass, public WiFiSTAClass, public WiFiScanClass, public WiFiAPClass
{
public:
using WiFiGenericClass::channel;
Expand All @@ -55,7 +54,8 @@ class WiFiClass : public WiFiGenericClass, public WiFiSTAClass, public WiFiScanC
using WiFiScanClass::BSSID;
using WiFiScanClass::BSSIDstr;
using WiFiScanClass::channel;
public:

public:
void printDiag(Print& dest);
friend class WiFiClient;
friend class WiFiServer;
Expand Down
39 changes: 17 additions & 22 deletions libraries/WiFi/src/WiFiClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,28 +495,23 @@ uint8_t WiFiClient::connected()
int res = recv(fd(), &dummy, 0, MSG_DONTWAIT);
// avoid unused var warning by gcc
(void)res;
// recv only sets errno if res is <= 0
if (res <= 0){
switch (errno) {
case EWOULDBLOCK:
case ENOENT: //caused by vfs
_connected = true;
break;
case ENOTCONN:
case EPIPE:
case ECONNRESET:
case ECONNREFUSED:
case ECONNABORTED:
_connected = false;
log_d("Disconnected: RES: %d, ERR: %d", res, errno);
break;
default:
log_i("Unexpected: RES: %d, ERR: %d", res, errno);
_connected = true;
break;
}
} else {
_connected = true;
switch (errno) {
case EWOULDBLOCK:
case ENOENT: //caused by vfs
_connected = true;
break;
case ENOTCONN:
case EPIPE:
case ECONNRESET:
case ECONNREFUSED:
case ECONNABORTED:
_connected = false;
log_d("Disconnected: RES: %d, ERR: %d", res, errno);
break;
default:
log_i("Unexpected: RES: %d, ERR: %d", res, errno);
_connected = true;
break;
}
}
return _connected;
Expand Down
Loading

0 comments on commit 6f2abf9

Please sign in to comment.