Skip to content

Commit 7ad58a2

Browse files
committed
warning cleanup: fix SocketHelpers argument types
- expect a 'const char*' for netmask (caused issues with string literals) - use a 'uint64_t' for additional_event_mask, as the extra bits are used by Zephyr. Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
1 parent feaddfa commit 7ad58a2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libraries/SocketWrapper/SocketHelpers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ int NetworkInterface::dhcp() {
6464
return 0;
6565
}
6666

67-
void NetworkInterface::enable_dhcpv4_server(struct net_if *netif, char *_netmask) {
67+
void NetworkInterface::enable_dhcpv4_server(struct net_if *netif, const char *_netmask) {
6868
static struct in_addr addr;
6969
static struct in_addr netmaskAddr;
7070

@@ -146,7 +146,7 @@ void NetworkInterface::setMACAddress(const uint8_t *mac) {
146146
net_if_up(netif); // Bring the interface back up after changing the MAC address
147147
}
148148

149-
int NetworkInterface::begin(bool blocking, uint32_t additional_event_mask) {
149+
int NetworkInterface::begin(bool blocking, uint64_t additional_event_mask) {
150150
dhcp();
151151
int ret = net_mgmt_event_wait_on_iface(netif, NET_EVENT_IPV4_ADDR_ADD | additional_event_mask,
152152
NULL, NULL, NULL, blocking ? K_FOREVER : K_SECONDS(1));

libraries/SocketWrapper/SocketHelpers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class NetworkInterface {
3434
protected:
3535
struct net_if *netif = nullptr;
3636
int dhcp();
37-
void enable_dhcpv4_server(struct net_if *netif, char *_netmask = "255.255.255.0");
37+
void enable_dhcpv4_server(struct net_if *netif, const char *_netmask = "255.255.255.0");
3838

3939
public:
4040
NetworkInterface() {
@@ -57,7 +57,7 @@ class NetworkInterface {
5757
void setGatewayIP(const IPAddress gateway);
5858
void setDnsServerIP(const IPAddress dns_server);
5959

60-
int begin(bool blocking = true, uint32_t additional_event_mask = 0);
60+
int begin(bool blocking = true, uint64_t additional_event_mask = 0);
6161

6262
bool disconnect();
6363
};

0 commit comments

Comments
 (0)