diff --git a/libraries/SocketWrapper/src/SocketHelpers.cpp b/libraries/SocketWrapper/src/SocketHelpers.cpp index 2e52663fa..f40f76348 100644 --- a/libraries/SocketWrapper/src/SocketHelpers.cpp +++ b/libraries/SocketWrapper/src/SocketHelpers.cpp @@ -50,6 +50,13 @@ arduino::IPAddress arduino::MbedSocketClass::dnsServerIP() { return ipAddressFromSocketAddress(ip); } +arduino::IPAddress arduino::MbedSocketClass::dnsIP(int n) { + SocketAddress ip; + NetworkInterface* interface = getNetwork(); + interface->get_dns_server(n, &ip, nullptr); + return ipAddressFromSocketAddress(ip); +} + void arduino::MbedSocketClass::config(arduino::IPAddress local_ip) { nsapi_addr_t convertedIP = { NSAPI_IPv4, { local_ip[0], local_ip[1], local_ip[2], local_ip[3] } }; _ip = SocketAddress(convertedIP); diff --git a/libraries/SocketWrapper/src/SocketHelpers.h b/libraries/SocketWrapper/src/SocketHelpers.h index 6934cf888..eea38386d 100644 --- a/libraries/SocketWrapper/src/SocketHelpers.h +++ b/libraries/SocketWrapper/src/SocketHelpers.h @@ -99,6 +99,13 @@ class MbedSocketClass { */ IPAddress dnsServerIP(); + /* + * Get the DNS Server ip address. + * + * return: DNS Server ip address value + */ + IPAddress dnsIP(int n = 0); + virtual NetworkInterface* getNetwork() = 0; int download(char* url, const char* target, bool const is_https = false); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy