mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-20 10:24:18 +03:00
Merge branch 'master' into feature/issue-2246-multi-wifi-hidden
This commit is contained in:
@ -21,7 +21,7 @@
|
||||
#include <memory>
|
||||
|
||||
|
||||
#ifdef DEBUG_ESP_SSL
|
||||
#if defined(DEBUG_ESP_SSL) && defined(DEBUG_ESP_PORT)
|
||||
#define DEBUG_BSSL(fmt, ...) DEBUG_ESP_PORT.printf_P((PGM_P)PSTR( "BSSL:" fmt), ## __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_BSSL(...)
|
||||
|
@ -827,15 +827,21 @@ bool ESP8266WiFiGenericClass::resumeFromShutdown (WiFiState* state)
|
||||
}
|
||||
}
|
||||
// state->state.fwconfig.bssid is not real bssid (it's what user may have provided when bssid_set==1)
|
||||
if (WiFi.begin((const char*)state->state.fwconfig.ssid,
|
||||
auto beginResult = WiFi.begin((const char*)state->state.fwconfig.ssid,
|
||||
(const char*)state->state.fwconfig.password,
|
||||
state->state.channel,
|
||||
nullptr/*(const uint8_t*)state->state.fwconfig.bssid*/, // <- try with gw's mac address?
|
||||
true) == WL_CONNECT_FAILED)
|
||||
true);
|
||||
if (beginResult == WL_CONNECT_FAILED)
|
||||
{
|
||||
DEBUG_WIFI("core: resume: WiFi.begin failed\n");
|
||||
return false;
|
||||
}
|
||||
if (beginResult == WL_WRONG_PASSWORD)
|
||||
{
|
||||
DEBUG_WIFI("core: resume: WiFi.begin wrong password\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (state->state.mode & WIFI_AP)
|
||||
|
@ -60,6 +60,9 @@ static void printWiFiStatus(wl_status_t status)
|
||||
case WL_CONNECT_FAILED:
|
||||
DEBUG_WIFI_MULTI("[WIFIM] Connecting failed.\n");
|
||||
break;
|
||||
case WL_WRONG_PASSWORD:
|
||||
DEBUG_WIFI_MULTI("[WIFIM] Wrong password.\n");
|
||||
break;
|
||||
default:
|
||||
DEBUG_WIFI_MULTI("[WIFIM] Connecting failed (%d).\n", status);
|
||||
break;
|
||||
|
@ -624,8 +624,9 @@ wl_status_t ESP8266WiFiSTAClass::status() {
|
||||
case STATION_NO_AP_FOUND:
|
||||
return WL_NO_SSID_AVAIL;
|
||||
case STATION_CONNECT_FAIL:
|
||||
case STATION_WRONG_PASSWORD:
|
||||
return WL_CONNECT_FAILED;
|
||||
case STATION_WRONG_PASSWORD:
|
||||
return WL_WRONG_PASSWORD;
|
||||
case STATION_IDLE:
|
||||
return WL_IDLE_STATUS;
|
||||
default:
|
||||
|
@ -59,7 +59,7 @@ extern "C" {
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_ESP_SSL
|
||||
#if defined(DEBUG_ESP_SSL) && defined(DEBUG_ESP_PORT)
|
||||
#define DEBUG_BSSL(fmt, ...) DEBUG_ESP_PORT.printf_P((PGM_P)PSTR( "BSSL:" fmt), ## __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_BSSL(...)
|
||||
@ -664,7 +664,7 @@ extern "C" {
|
||||
if (!xc->done_cert) {
|
||||
br_sha1_update(&xc->sha1_cert, buf, len);
|
||||
br_x509_decoder_push(&xc->ctx, (const void*)buf, len);
|
||||
#ifdef DEBUG_ESP_SSL
|
||||
#if defined(DEBUG_ESP_SSL) && defined(DEBUG_ESP_PORT)
|
||||
DEBUG_BSSL("CERT: ");
|
||||
for (size_t i=0; i<len; i++) {
|
||||
DEBUG_ESP_PORT.printf_P(PSTR("%02x "), buf[i] & 0xff);
|
||||
|
@ -44,18 +44,12 @@ extern "C" {
|
||||
WiFiServer::WiFiServer(const IPAddress& addr, uint16_t port)
|
||||
: _port(port)
|
||||
, _addr(addr)
|
||||
, _listen_pcb(nullptr)
|
||||
, _unclaimed(nullptr)
|
||||
, _discarded(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
WiFiServer::WiFiServer(uint16_t port)
|
||||
: _port(port)
|
||||
, _addr(IP_ANY_TYPE)
|
||||
, _listen_pcb(nullptr)
|
||||
, _unclaimed(nullptr)
|
||||
, _discarded(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -70,10 +70,10 @@ class WiFiServer : public Server {
|
||||
protected:
|
||||
uint16_t _port;
|
||||
IPAddress _addr;
|
||||
tcp_pcb* _listen_pcb;
|
||||
tcp_pcb* _listen_pcb = nullptr;
|
||||
|
||||
ClientContext* _unclaimed;
|
||||
ClientContext* _discarded;
|
||||
ClientContext* _unclaimed = nullptr;
|
||||
ClientContext* _discarded = nullptr;
|
||||
enum { _ndDefault, _ndFalse, _ndTrue } _noDelay = _ndDefault;
|
||||
|
||||
public:
|
||||
|
@ -55,7 +55,8 @@ typedef enum {
|
||||
WL_CONNECTED = 3,
|
||||
WL_CONNECT_FAILED = 4,
|
||||
WL_CONNECTION_LOST = 5,
|
||||
WL_DISCONNECTED = 6
|
||||
WL_WRONG_PASSWORD = 6,
|
||||
WL_DISCONNECTED = 7
|
||||
} wl_status_t;
|
||||
|
||||
/* Encryption modes */
|
||||
|
Reference in New Issue
Block a user