Skip to content

Commit 2badf92

Browse files
committed
EthernetUDP: fix stray references to WiFi
1 parent ddef82e commit 2badf92

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libraries/Ethernet/src/EthernetUdp.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ arduino::EthernetUDP::~EthernetUDP() {
2020
uint8_t arduino::EthernetUDP::begin(uint16_t port) {
2121
// success = 1, fail = 0
2222

23-
nsapi_error_t rt = _socket.open(WiFi.getNetwork());
23+
nsapi_error_t rt = _socket.open(Ethernet.getNetwork());
2424
if (rt != NSAPI_ERROR_OK) {
2525
return 0;
2626
}
@@ -43,8 +43,8 @@ uint8_t arduino::EthernetUDP::beginMulticast(IPAddress ip, uint16_t port) {
4343
if(begin(port) != 1){
4444
return 0;
4545
}
46-
47-
SocketAddress socketAddress = WiFi.socketAddressFromIpAddress(ip, port);
46+
47+
SocketAddress socketAddress = Ethernet.socketAddressFromIpAddress(ip, port);
4848

4949
if (_socket.join_multicast_group(socketAddress) != NSAPI_ERROR_OK) {
5050
printf("Error joining the multicast group\n");
@@ -59,7 +59,7 @@ void arduino::EthernetUDP::stop() {
5959
}
6060

6161
int arduino::EthernetUDP::beginPacket(IPAddress ip, uint16_t port) {
62-
_host = WiFi.socketAddressFromIpAddress(ip, port);
62+
_host = Ethernet.socketAddressFromIpAddress(ip, port);
6363
//If IP is null and port is 0 the initialization failed
6464
return (_host.get_ip_address() == nullptr && _host.get_port() == 0) ? 0 : 1;
6565
}

0 commit comments

Comments
 (0)