Skip to content

Commit

Permalink
Removed GetWiFiBeaconRxCount from connectivityutills
Browse files Browse the repository at this point in the history
  • Loading branch information
Thirsrin committed Apr 2, 2024
1 parent 05fa50a commit d2fb328
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 34 deletions.
23 changes: 0 additions & 23 deletions src/platform/Linux/ConnectivityUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,29 +573,6 @@ CHIP_ERROR ConnectivityUtils::GetWiFiBeaconLostCount(const char * ifname, uint32
return err;
}

CHIP_ERROR ConnectivityUtils::GetWiFiBeaconRxCount(const char * ifname, uint32_t & beaconRxCount)
{
CHIP_ERROR err = CHIP_ERROR_READ_FAILED;
struct iw_statistics stats;
int skfd;

if ((skfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
{
ChipLogError(DeviceLayer, "Failed to create a channel to the NET kernel.");
return CHIP_ERROR_OPEN_FAILED;
}

if (GetWiFiStats(skfd, ifname, &stats) == CHIP_NO_ERROR)
{
beaconRxCount = stats.miss.beacon;
err = CHIP_NO_ERROR;
}

close(skfd);

return err;
}

CHIP_ERROR ConnectivityUtils::GetWiFiCurrentMaxRate(const char * ifname, uint64_t & currentMaxRate)
{
CHIP_ERROR err = CHIP_ERROR_READ_FAILED;
Expand Down
1 change: 0 additions & 1 deletion src/platform/Linux/ConnectivityUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class ConnectivityUtils
static CHIP_ERROR GetWiFiChannelNumber(const char * ifname, uint16_t & channelNumber);
static CHIP_ERROR GetWiFiRssi(const char * ifname, int8_t & rssi);
static CHIP_ERROR GetWiFiBeaconLostCount(const char * ifname, uint32_t & beaconLostCount);
static CHIP_ERROR GetWiFiBeaconRxCount(const char * ifname, uint32_t & beaconRxCount);
static CHIP_ERROR GetWiFiCurrentMaxRate(const char * ifname, uint64_t & currentMaxRate);
static CHIP_ERROR GetEthInterfaceName(char * ifname, size_t bufSize);
static CHIP_ERROR GetEthPHYRate(const char * ifname, app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum & pHYRate);
Expand Down
11 changes: 1 addition & 10 deletions src/platform/Linux/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,16 +761,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiOverrunCount(uint64_t & overrunCou

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBeaconRxCount(uint32_t & beaconRxCount)
{
uint32_t count;

if (ConnectivityMgrImpl().GetWiFiIfName() == nullptr)
{
return CHIP_ERROR_READ_FAILED;
}

ReturnErrorOnFailure(ConnectivityUtils::GetWiFiBeaconRxCount(ConnectivityMgrImpl().GetWiFiIfName(), count));
VerifyOrReturnError(count >= mBeaconRxCount, CHIP_ERROR_INVALID_INTEGER_VALUE);
beaconRxCount = count - mBeaconRxCount;
beaconRxCount = mBeaconRxCount;

return CHIP_NO_ERROR;
}
Expand Down

0 comments on commit d2fb328

Please sign in to comment.