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
871dd183
Commit
871dd183
authored
Jul 05, 2018
by
me-no-dev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print to debug the IP address obtained by DHCP
parent
05111bbd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
component.mk
component.mk
+1
-1
libraries/WiFi/src/WiFiGeneric.cpp
libraries/WiFi/src/WiFiGeneric.cpp
+18
-0
No files found.
component.mk
View file @
871dd183
ARDUINO_CORE_LIBS
:=
$(
patsubst
$(COMPONENT_PATH)
/%,%,
$(
sort
$(
dir
$(
wildcard
$(COMPONENT_PATH)
/libraries/
*
/
*
/
*
/
))))
ARDUINO_CORE_LIBS
:=
$(
patsubst
$(COMPONENT_PATH)
/%,%,
$(
sort
$(
dir
$(
wildcard
$(COMPONENT_PATH)
/libraries/
*
/
*
/
))
$(
dir
$(
wildcard
$(COMPONENT_PATH)
/libraries/
*
/
*
/
*
/
))))
COMPONENT_ADD_INCLUDEDIRS
:=
cores/esp32 variants/esp32
$(ARDUINO_CORE_LIBS)
COMPONENT_PRIV_INCLUDEDIRS
:=
cores/esp32/libb64
...
...
libraries/WiFi/src/WiFiGeneric.cpp
View file @
871dd183
...
...
@@ -376,6 +376,15 @@ esp_err_t WiFiGenericClass::_eventCallback(void *arg, system_event_t *event)
WiFi
.
begin
();
}
}
else
if
(
event
->
event_id
==
SYSTEM_EVENT_STA_GOT_IP
)
{
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
uint8_t
*
ip
=
(
uint8_t
*
)
&
(
event
->
event_info
.
got_ip
.
ip_info
.
ip
.
addr
);
uint8_t
*
mask
=
(
uint8_t
*
)
&
(
event
->
event_info
.
got_ip
.
ip_info
.
netmask
.
addr
);
uint8_t
*
gw
=
(
uint8_t
*
)
&
(
event
->
event_info
.
got_ip
.
ip_info
.
gw
.
addr
);
log_d
(
"STA IP: %u.%u.%u.%u, MASK: %u.%u.%u.%u, GW: %u.%u.%u.%u"
,
ip
[
0
],
ip
[
1
],
ip
[
2
],
ip
[
3
],
mask
[
0
],
mask
[
1
],
mask
[
2
],
mask
[
3
],
gw
[
0
],
gw
[
1
],
gw
[
2
],
gw
[
3
]);
#endif
WiFiSTAClass
::
_setStatus
(
WL_CONNECTED
);
setStatusBits
(
STA_HAS_IP_BIT
|
STA_CONNECTED_BIT
);
}
else
if
(
event
->
event_id
==
SYSTEM_EVENT_STA_LOST_IP
)
{
...
...
@@ -403,6 +412,15 @@ esp_err_t WiFiGenericClass::_eventCallback(void *arg, system_event_t *event)
}
else
if
(
event
->
event_id
==
SYSTEM_EVENT_ETH_DISCONNECTED
)
{
clearStatusBits
(
ETH_CONNECTED_BIT
|
ETH_HAS_IP_BIT
|
ETH_HAS_IP6_BIT
);
}
else
if
(
event
->
event_id
==
SYSTEM_EVENT_ETH_GOT_IP
)
{
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
uint8_t
*
ip
=
(
uint8_t
*
)
&
(
event
->
event_info
.
got_ip
.
ip_info
.
ip
.
addr
);
uint8_t
*
mask
=
(
uint8_t
*
)
&
(
event
->
event_info
.
got_ip
.
ip_info
.
netmask
.
addr
);
uint8_t
*
gw
=
(
uint8_t
*
)
&
(
event
->
event_info
.
got_ip
.
ip_info
.
gw
.
addr
);
log_d
(
"ETH IP: %u.%u.%u.%u, MASK: %u.%u.%u.%u, GW: %u.%u.%u.%u"
,
ip
[
0
],
ip
[
1
],
ip
[
2
],
ip
[
3
],
mask
[
0
],
mask
[
1
],
mask
[
2
],
mask
[
3
],
gw
[
0
],
gw
[
1
],
gw
[
2
],
gw
[
3
]);
#endif
setStatusBits
(
ETH_CONNECTED_BIT
|
ETH_HAS_IP_BIT
);
}
else
if
(
event
->
event_id
==
SYSTEM_EVENT_GOT_IP6
)
{
...
...
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