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-pico
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-pico
Commits
4f62e0a4
Unverified
Commit
4f62e0a4
authored
Nov 29, 2023
by
Juraj Andrássy
Committed by
GitHub
Nov 29, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LwipIntfDev - added macAddress getter and DNS IP getter and setter (#1856)
and dnsIP(n) getter in WiFiClass too
parent
dbab62c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
0 deletions
+31
-0
libraries/WiFi/src/WiFiClass.cpp
libraries/WiFi/src/WiFiClass.cpp
+9
-0
libraries/WiFi/src/WiFiClass.h
libraries/WiFi/src/WiFiClass.h
+7
-0
libraries/lwIP_Ethernet/src/LwipIntfDev.h
libraries/lwIP_Ethernet/src/LwipIntfDev.h
+15
-0
No files found.
libraries/WiFi/src/WiFiClass.cpp
View file @
4f62e0a4
...
...
@@ -326,6 +326,15 @@ IPAddress WiFiClass::gatewayIP() {
return
_wifi
.
gatewayIP
();
}
/*
Get the DNS ip address.
return: IPAddress DNS Server IP
*/
IPAddress
WiFiClass
::
dnsIP
(
uint8_t
dns_no
)
{
return
_wifi
.
dnsIP
(
dns_no
);
}
/*
Return the current SSID associated with the network
...
...
libraries/WiFi/src/WiFiClass.h
View file @
4f62e0a4
...
...
@@ -261,6 +261,13 @@ public:
*/
IPAddress
gatewayIP
();
/*
Get the DNS ip address.
return: IPAddress DNS Server IP
*/
IPAddress
dnsIP
(
uint8_t
dns_no
=
0
);
/*
Return the current SSID associated with the network
...
...
libraries/lwIP_Ethernet/src/LwipIntfDev.h
View file @
4f62e0a4
...
...
@@ -73,6 +73,10 @@ public:
return
&
_netif
;
}
uint8_t
*
macAddress
(
uint8_t
*
mac
)
{
memcpy
(
mac
,
&
_netif
.
hwaddr
,
6
);
return
mac
;
}
IPAddress
localIP
()
const
{
return
IPAddress
(
ip4_addr_get_u32
(
ip_2_ip4
(
&
_netif
.
ip_addr
)));
}
...
...
@@ -82,6 +86,17 @@ public:
IPAddress
gatewayIP
()
const
{
return
IPAddress
(
ip4_addr_get_u32
(
ip_2_ip4
(
&
_netif
.
gw
)));
}
IPAddress
dnsIP
(
int
n
=
0
)
const
{
return
IPAddress
(
dns_getserver
(
n
));
}
void
setDNS
(
IPAddress
dns1
,
IPAddress
dns2
=
INADDR_ANY
)
{
if
(
dns1
.
isSet
())
{
dns_setserver
(
0
,
dns1
);
}
if
(
dns2
.
isSet
())
{
dns_setserver
(
1
,
dns2
);
}
}
// 1. Currently when no default is set, esp8266-Arduino uses the first
// DHCP client interface receiving a valid address and gateway to
...
...
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