Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
52575d63
Unverified
Commit
52575d63
authored
Feb 28, 2022
by
P-R-O-C-H-Y
Committed by
GitHub
Feb 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed wifiBegin to fail wfile connecting to same AP without previous disconnecting (#6359)
parent
d1f0d6c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
libraries/WiFi/src/WiFiGeneric.cpp
libraries/WiFi/src/WiFiGeneric.cpp
+12
-2
No files found.
libraries/WiFi/src/WiFiGeneric.cpp
View file @
52575d63
...
...
@@ -835,6 +835,8 @@ const char * system_event_reasons[] = { "UNSPECIFIED", "AUTH_EXPIRE", "AUTH_LEAV
#endif
esp_err_t
WiFiGenericClass
::
_eventCallback
(
arduino_event_t
*
event
)
{
static
bool
first_connect
=
true
;
if
(
event
->
event_id
<
ARDUINO_EVENT_MAX
)
{
log_d
(
"Arduino Event: %d - %s"
,
event
->
event_id
,
arduino_event_names
[
event
->
event_id
]);
}
...
...
@@ -860,7 +862,7 @@ esp_err_t WiFiGenericClass::_eventCallback(arduino_event_t *event)
log_w
(
"Reason: %u - %s"
,
reason
,
reason2str
(
reason
));
if
(
reason
==
WIFI_REASON_NO_AP_FOUND
)
{
WiFiSTAClass
::
_setStatus
(
WL_NO_SSID_AVAIL
);
}
else
if
(
reason
==
WIFI_REASON_AUTH_FAIL
)
{
}
else
if
(
(
reason
==
WIFI_REASON_AUTH_FAIL
)
&&
!
first_connect
)
{
WiFiSTAClass
::
_setStatus
(
WL_CONNECT_FAILED
);
}
else
if
(
reason
==
WIFI_REASON_BEACON_TIMEOUT
||
reason
==
WIFI_REASON_HANDSHAKE_TIMEOUT
)
{
WiFiSTAClass
::
_setStatus
(
WL_CONNECTION_LOST
);
...
...
@@ -870,7 +872,15 @@ esp_err_t WiFiGenericClass::_eventCallback(arduino_event_t *event)
WiFiSTAClass
::
_setStatus
(
WL_DISCONNECTED
);
}
clearStatusBits
(
STA_CONNECTED_BIT
|
STA_HAS_IP_BIT
|
STA_HAS_IP6_BIT
);
if
(
WiFi
.
getAutoReconnect
()){
if
(
first_connect
&&
((
reason
==
WIFI_REASON_AUTH_EXPIRE
)
||
(
reason
>=
WIFI_REASON_BEACON_TIMEOUT
)))
{
log_d
(
"WiFi Reconnect Running"
);
WiFi
.
disconnect
();
WiFi
.
begin
();
first_connect
=
false
;
}
else
if
(
WiFi
.
getAutoReconnect
()){
if
((
reason
==
WIFI_REASON_AUTH_EXPIRE
)
||
(
reason
>=
WIFI_REASON_BEACON_TIMEOUT
&&
reason
!=
WIFI_REASON_AUTH_FAIL
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment