Skip to content

Commit cd7432b

Browse files
committed
ethernet: squash remove setters
1 parent 88753c3 commit cd7432b

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

libraries/SocketWrapper/SocketHelpers.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ bool NetworkInterface::setLocalIPFull(IPAddress ip, IPAddress subnet, IPAddress
169169
return true;
170170
}
171171

172-
void NetworkInterface::setLocalIP(IPAddress ip) {
172+
void NetworkInterface::setLocalIP(const IPAddress ip) {
173173
struct in_addr addr;
174174
addr.s_addr = ip;
175175

@@ -178,22 +178,25 @@ void NetworkInterface::setLocalIP(IPAddress ip) {
178178
return;
179179
}
180180
LOG_INF("Local IP address set: %s", ip.toString().c_str());
181+
return;
181182
}
182183

183-
void NetworkInterface::setSubnetMask(IPAddress subnet) {
184+
void NetworkInterface::setSubnetMask(const IPAddress subnet) {
184185
struct in_addr netmask_addr;
185186
netmask_addr.s_addr = subnet;
186187
net_if_ipv4_set_netmask(netif, &netmask_addr);
187188
LOG_INF("Subnet mask set: %s", subnet.toString().c_str());
189+
return;
188190
}
189191

190-
void NetworkInterface::setGatewayIP(IPAddress gateway) {
192+
void NetworkInterface::setGatewayIP(const IPAddress gateway) {
191193
struct in_addr gw_addr;
192194
gw_addr.s_addr = gateway;
193195
net_if_ipv4_set_gw(netif, &gw_addr);
194196
LOG_INF("Gateway IP set: %s", gateway.toString().c_str());
197+
return;
195198
}
196199

197-
void NetworkInterface::setDnsServerIP(IPAddress dns_server) {
200+
void NetworkInterface::setDnsServerIP(const IPAddress dns_server) {
198201
return; // DNS server dynamic configuration is not supported
199202
}

libraries/SocketWrapper/SocketHelpers.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ class NetworkInterface {
5151

5252
void setMACAddress(const uint8_t *mac);
5353
bool setLocalIPFull(IPAddress ip, IPAddress subnet, IPAddress gateway);
54-
void setLocalIP(IPAddress ip);
55-
void setSubnetMask(IPAddress subnet);
56-
void setGatewayIP(IPAddress gateway);
57-
void setDnsServerIP(IPAddress dns_server);
54+
void setLocalIP(const IPAddress ip);
55+
void setSubnetMask(const IPAddress subnet);
56+
void setGatewayIP(const IPAddress gateway);
57+
void setDnsServerIP(const IPAddress dns_server);
5858

5959
int begin(bool blocking = true, uint32_t additional_event_mask = 0);
6060

0 commit comments

Comments
 (0)