From d2fb3281356e6636e6869a0eb5c0756db5fa8f05 Mon Sep 17 00:00:00 2001 From: Thirupathi S Date: Tue, 2 Apr 2024 14:33:32 +0530 Subject: [PATCH] Removed GetWiFiBeaconRxCount from connectivityutills --- src/platform/Linux/ConnectivityUtils.cpp | 23 ------------------- src/platform/Linux/ConnectivityUtils.h | 1 - .../Linux/DiagnosticDataProviderImpl.cpp | 11 +-------- 3 files changed, 1 insertion(+), 34 deletions(-) diff --git a/src/platform/Linux/ConnectivityUtils.cpp b/src/platform/Linux/ConnectivityUtils.cpp index fef62cc54a3c67..8084ceca43b55a 100644 --- a/src/platform/Linux/ConnectivityUtils.cpp +++ b/src/platform/Linux/ConnectivityUtils.cpp @@ -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; diff --git a/src/platform/Linux/ConnectivityUtils.h b/src/platform/Linux/ConnectivityUtils.h index 03b2bc62a2ee1c..1ea060b0da7842 100644 --- a/src/platform/Linux/ConnectivityUtils.h +++ b/src/platform/Linux/ConnectivityUtils.h @@ -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); diff --git a/src/platform/Linux/DiagnosticDataProviderImpl.cpp b/src/platform/Linux/DiagnosticDataProviderImpl.cpp index d1345680df6ef4..3802d968d72c94 100644 --- a/src/platform/Linux/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Linux/DiagnosticDataProviderImpl.cpp @@ -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; }