Skip to content

Commit

Permalink
Minor cast fix to put on work with Raspberry Pi Pico (and all rp2040 …
Browse files Browse the repository at this point in the history
…boards)
  • Loading branch information
xreef committed Sep 26, 2022
1 parent 8e741a2 commit 644bc29
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/utility/wifi_drv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ uint8_t* WiFiDrv::getMacAddress()
return _mac;
}

#ifdef ARDUINO_ARCH_RP2040
void WiFiDrv::getIpAddress(IPAddress& ip)
{
getNetworkData(_localIp, _subnetMask, _gatewayIp);
Expand All @@ -395,6 +396,26 @@ void WiFiDrv::getIpAddress(IPAddress& ip)
getNetworkData(_localIp, _subnetMask, _gatewayIp);
ip = IPAddress(_gatewayIp);
}
#else
void WiFiDrv::getIpAddress(IPAddress& ip)
{
getNetworkData(_localIp, _subnetMask, _gatewayIp);
ip = _localIp;
}

void WiFiDrv::getSubnetMask(IPAddress& mask)
{
getNetworkData(_localIp, _subnetMask, _gatewayIp);
mask = _subnetMask;
}

void WiFiDrv::getGatewayIP(IPAddress& ip)
{
getNetworkData(_localIp, _subnetMask, _gatewayIp);
ip = _gatewayIp;
}
#endif


const char* WiFiDrv::getCurrentSSID()
{
Expand Down

0 comments on commit 644bc29

Please sign in to comment.