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
9e288839
Commit
9e288839
authored
Nov 19, 2018
by
Rob de Jonge
Committed by
Me No Dev
Nov 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a message for all event types. (#1916)
parent
a4368259
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
12 deletions
+78
-12
libraries/WiFi/examples/WiFiClientEvents/WiFiClientEvents.ino
...aries/WiFi/examples/WiFiClientEvents/WiFiClientEvents.ino
+78
-12
No files found.
libraries/WiFi/examples/WiFiClientEvents/WiFiClientEvents.ino
View file @
9e288839
...
...
@@ -43,18 +43,84 @@ void WiFiEvent(WiFiEvent_t event)
{
Serial
.
printf
(
"[WiFi-event] event: %d
\n
"
,
event
);
switch
(
event
)
{
case
SYSTEM_EVENT_STA_GOT_IP
:
Serial
.
println
(
"WiFi connected"
);
Serial
.
println
(
"IP address: "
);
Serial
.
println
(
WiFi
.
localIP
());
break
;
case
SYSTEM_EVENT_STA_DISCONNECTED
:
Serial
.
println
(
"WiFi lost connection"
);
break
;
}
}
switch
(
event
)
{
case
SYSTEM_EVENT_WIFI_READY
:
Serial
.
println
(
"WiFi interface ready"
);
break
;
case
SYSTEM_EVENT_SCAN_DONE
:
Serial
.
println
(
"Completed scan for access points"
);
break
;
case
SYSTEM_EVENT_STA_START
:
Serial
.
println
(
"WiFi client started"
);
break
;
case
SYSTEM_EVENT_STA_STOP
:
Serial
.
println
(
"WiFi clients stopped"
);
break
;
case
SYSTEM_EVENT_STA_CONNECTED
:
Serial
.
println
(
"Connected to access point"
);
break
;
case
SYSTEM_EVENT_STA_DISCONNECTED
:
Serial
.
println
(
"Disconnected from WiFi access point"
);
break
;
case
SYSTEM_EVENT_STA_AUTHMODE_CHANGE
:
Serial
.
println
(
"Authentication mode of access point has changed"
);
break
;
case
SYSTEM_EVENT_STA_GOT_IP
:
Serial
.
print
(
"Obtained IP address: "
);
Serial
.
println
(
WiFi
.
localIP
());
break
;
case
SYSTEM_EVENT_STA_LOST_IP
:
Serial
.
println
(
"Lost IP address and IP address is reset to 0"
);
break
;
case
SYSTEM_EVENT_STA_WPS_ER_SUCCESS
:
Serial
.
println
(
"WiFi Protected Setup (WPS): succeeded in enrollee mode"
);
break
;
case
SYSTEM_EVENT_STA_WPS_ER_FAILED
:
Serial
.
println
(
"WiFi Protected Setup (WPS): failed in enrollee mode"
);
break
;
case
SYSTEM_EVENT_STA_WPS_ER_TIMEOUT
:
Serial
.
println
(
"WiFi Protected Setup (WPS): timeout in enrollee mode"
);
break
;
case
SYSTEM_EVENT_STA_WPS_ER_PIN
:
Serial
.
println
(
"WiFi Protected Setup (WPS): pin code in enrollee mode"
);
break
;
case
SYSTEM_EVENT_AP_START
:
Serial
.
println
(
"WiFi access point started"
);
break
;
case
SYSTEM_EVENT_AP_STOP
:
Serial
.
println
(
"WiFi access point stopped"
);
break
;
case
SYSTEM_EVENT_AP_STACONNECTED
:
Serial
.
println
(
"Client connected"
);
break
;
case
SYSTEM_EVENT_AP_STADISCONNECTED
:
Serial
.
println
(
"Client disconnected"
);
break
;
case
SYSTEM_EVENT_AP_STAIPASSIGNED
:
Serial
.
println
(
"Assigned IP address to client"
);
break
;
case
SYSTEM_EVENT_AP_PROBEREQRECVED
:
Serial
.
println
(
"Received probe request"
);
break
;
case
SYSTEM_EVENT_GOT_IP6
:
Serial
.
println
(
"IPv6 is preferred"
);
break
;
case
SYSTEM_EVENT_ETH_START
:
Serial
.
println
(
"Ethernet started"
);
break
;
case
SYSTEM_EVENT_ETH_STOP
:
Serial
.
println
(
"Ethernet stopped"
);
break
;
case
SYSTEM_EVENT_ETH_CONNECTED
:
Serial
.
println
(
"Ethernet connected"
);
break
;
case
SYSTEM_EVENT_ETH_DISCONNECTED
:
Serial
.
println
(
"Ethernet disconnected"
);
break
;
case
SYSTEM_EVENT_ETH_GOT_IP
:
Serial
.
println
(
"Obtained IP address"
);
break
;
}}
void
WiFiGotIP
(
WiFiEvent_t
event
,
WiFiEventInfo_t
info
)
{
...
...
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