fix portduino build

This commit is contained in:
Thomas Göttgens 2025-07-19 16:26:56 +02:00
parent af3ddddcf4
commit ac74703268
2 changed files with 3 additions and 3 deletions

View File

@ -42,10 +42,10 @@ class UdpMulticastHandler final
void onReceive(AsyncUDPPacket packet)
{
size_t packetLength = packet.length();
#if defined(ARCH_NRF52) || defined(ARCH_PORTDUINO)
#if defined(ARCH_NRF52)
IPAddress ip = packet.remoteIP();
LOG_DEBUG("UDP broadcast from: %u.%u.%u.%u, len=%u", ip[0], ip[1], ip[2], ip[3], packetLength);
#else
#elif !defined(ARCH_PORTDUINO)
// FIXME(PORTDUINO): arduino lacks IPAddress::toString()
LOG_DEBUG("UDP broadcast from: %s, len=%u", packet.remoteIP().toString().c_str(), packetLength);
#endif

View File

@ -35,7 +35,7 @@ bool AsyncUDP::writeTo(const uint8_t *data, size_t len, IPAddress ip, uint16_t p
}
// AsyncUDPPacket
AsyncUDPPacket::AsyncUDPPacket(EthernetUDP &source) : _udp(source), _remoteIP(source.remoteIP()), _remotePort(source.remotePort())
AsyncUDPPacket::AsyncUDPPacket(EthernetUDP &source) : _udp(source), _remoteIP(source.remoteIP())
{
if (_udp.available() > 0) {
_readLength = _udp.read(_buffer, sizeof(_buffer));