@@ -64,6 +64,20 @@ int CEthernet::begin(IPAddress local_ip, IPAddress subnet, IPAddress gateway, IP
64
64
return 1 ;
65
65
}
66
66
67
+ /* -------------------------------------------------------------------------- */
68
+ void CEthernet::setHostname (const char * hostname) {
69
+ /* -------------------------------------------------------------------------- */
70
+ if (ni != nullptr ) {
71
+ ni->setHostname (hostname);
72
+ }
73
+ }
74
+
75
+ /* -------------------------------------------------------------------------- */
76
+ void CEthernet::setDnsServerIP (IPAddress dns_server) {
77
+ /* -------------------------------------------------------------------------- */
78
+ setDNS (dns_server);
79
+ }
80
+
67
81
/* -------------------------------------------------------------------------- */
68
82
void CEthernet::setDNS (IPAddress dns_server) {
69
83
/* -------------------------------------------------------------------------- */
@@ -178,6 +192,11 @@ void CEthernet::MACAddress(uint8_t *mac) {
178
192
CLwipIf::getInstance ().getMacAddress (NI_ETHERNET, mac);
179
193
}
180
194
195
+ uint8_t * CEthernet::macAddress (uint8_t *mac) {
196
+ CLwipIf::getInstance ().getMacAddress (NI_ETHERNET, mac);
197
+ return mac;
198
+ }
199
+
181
200
IPAddress CEthernet::localIP () {
182
201
if (ni != nullptr ) {
183
202
return IPAddress (ni->getIpAdd ());
@@ -203,4 +222,14 @@ IPAddress CEthernet::dnsServerIP() {
203
222
return CLwipIf::getInstance ().getDns ();
204
223
}
205
224
225
+ IPAddress CEthernet::dnsIP (int n) {
226
+ return CLwipIf::getInstance ().getDns (n);
227
+ }
228
+
229
+ /* -------------------------------------------------------------------------- */
230
+ int CEthernet::hostByName (const char * hostname, IPAddress& result) {
231
+ /* -------------------------------------------------------------------------- */
232
+ return CLwipIf::getInstance ().getHostByName (hostname, result);
233
+ }
234
+
206
235
CEthernet Ethernet;
0 commit comments