Skip to content

Commit 3625ad9

Browse files
committed
added const keyword to Ethernet.hostname() & Dhcp.getHostname()
1 parent 7000c8d commit 3625ad9

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/Dhcp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ IPAddress DhcpClass::getDnsServerIp()
474474
return IPAddress(_dhcpDnsServerIp);
475475
}
476476

477-
char* DhcpClass::getHostname()
477+
const char* DhcpClass::getHostname() const
478478
{
479479
return _dhcpHostname;
480480
}

src/Dhcp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class DhcpClass {
171171
IPAddress getGatewayIp();
172172
IPAddress getDhcpServerIp();
173173
IPAddress getDnsServerIp();
174-
char* getHostname();
174+
const char* getHostname() const;
175175

176176
int beginWithDHCP(uint8_t *, unsigned long timeout = 60000, unsigned long responseTimeout = 4000);
177177
int beginWithDHCP(uint8_t *, const char *, unsigned long timeout = 60000, unsigned long responseTimeout = 4000);

src/Ethernet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ IPAddress EthernetClass::dnsServerIP()
138138
return _dnsServerAddress;
139139
}
140140

141-
char* EthernetClass::hostname()
141+
const char* EthernetClass::hostname() const
142142
{
143143
return _dhcp ? _dhcp->getHostname() : "";
144144
}

src/Ethernet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class EthernetClass {
3232
IPAddress subnetMask();
3333
IPAddress gatewayIP();
3434
IPAddress dnsServerIP();
35-
char* hostname();
35+
const char* hostname() const;
3636

3737
friend class EthernetClient;
3838
friend class EthernetServer;

0 commit comments

Comments
 (0)