From aef5db43b94095b5d60e94ba2009ca29ae92cdd0 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Wed, 15 Sep 2021 16:05:12 -0700 Subject: [PATCH] Move ethernet diagnostic APIs to GenericConnectivityManagerImpl (#9727) --- .../internal/GenericConnectivityManagerImpl.h | 36 +++++++++++++++++++ .../GenericConnectivityManagerImpl_NoWiFi.h | 35 ------------------ .../GenericConnectivityManagerImpl_WiFi.h | 35 ------------------ 3 files changed, 36 insertions(+), 70 deletions(-) diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl.h b/src/include/platform/internal/GenericConnectivityManagerImpl.h index 6315c25a701b51..044d83857eb2e6 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl.h @@ -47,6 +47,12 @@ class GenericConnectivityManagerImpl uint16_t _GetUserSelectedModeTimeout(); void _SetUserSelectedModeTimeout(uint16_t val); + CHIP_ERROR _GetEthPacketRxCount(uint64_t & packetRxCount); + CHIP_ERROR _GetEthPacketTxCount(uint64_t & packetTxCount); + CHIP_ERROR _GetEthTxErrCount(uint64_t & txErrCount); + CHIP_ERROR _GetEthCollisionCount(uint64_t & collisionCount); + CHIP_ERROR _GetEthOverrunCount(uint64_t & overrunCount); + private: ImplClass * Impl() { return static_cast(this); } }; @@ -71,6 +77,36 @@ template inline void GenericConnectivityManagerImpl::_SetUserSelectedModeTimeout(uint16_t val) {} +template +inline CHIP_ERROR GenericConnectivityManagerImpl::_GetEthPacketRxCount(uint64_t & packetRxCount) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +template +inline CHIP_ERROR GenericConnectivityManagerImpl::_GetEthPacketTxCount(uint64_t & packetTxCount) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +template +inline CHIP_ERROR GenericConnectivityManagerImpl::_GetEthTxErrCount(uint64_t & txErrCount) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +template +inline CHIP_ERROR GenericConnectivityManagerImpl::_GetEthCollisionCount(uint64_t & collisionCount) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +template +inline CHIP_ERROR GenericConnectivityManagerImpl::_GetEthOverrunCount(uint64_t & overrunCount) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + } // namespace Internal } // namespace DeviceLayer } // namespace chip diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h b/src/include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h index 33b5e1405d908d..af744bbf4da9fd 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h @@ -73,11 +73,6 @@ class GenericConnectivityManagerImpl_NoWiFi uint32_t _GetWiFiAPIdleTimeoutMS(void); void _SetWiFiAPIdleTimeoutMS(uint32_t val); CHIP_ERROR _GetAndLogWifiStatsCounters(void); - CHIP_ERROR _GetEthPacketRxCount(uint64_t & packetRxCount); - CHIP_ERROR _GetEthPacketTxCount(uint64_t & packetTxCount); - CHIP_ERROR _GetEthTxErrCount(uint64_t & txErrCount); - CHIP_ERROR _GetEthCollisionCount(uint64_t & collisionCount); - CHIP_ERROR _GetEthOverrunCount(uint64_t & overrunCount); bool _CanStartWiFiScan(); void _OnWiFiScanDone(); void _OnWiFiStationProvisionChange(); @@ -240,36 +235,6 @@ inline const char * GenericConnectivityManagerImpl_NoWiFi::_WiFiAPSta return NULL; } -template -inline CHIP_ERROR GenericConnectivityManagerImpl_NoWiFi::_GetEthPacketRxCount(uint64_t & packetRxCount) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} - -template -inline CHIP_ERROR GenericConnectivityManagerImpl_NoWiFi::_GetEthPacketTxCount(uint64_t & packetTxCount) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} - -template -inline CHIP_ERROR GenericConnectivityManagerImpl_NoWiFi::_GetEthTxErrCount(uint64_t & txErrCount) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} - -template -inline CHIP_ERROR GenericConnectivityManagerImpl_NoWiFi::_GetEthCollisionCount(uint64_t & collisionCount) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} - -template -inline CHIP_ERROR GenericConnectivityManagerImpl_NoWiFi::_GetEthOverrunCount(uint64_t & overrunCount) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} - } // namespace Internal } // namespace DeviceLayer } // namespace chip diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.h b/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.h index 36431caa1b41e5..9fe2fd66437050 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.h @@ -73,11 +73,6 @@ class GenericConnectivityManagerImpl_WiFi uint32_t _GetWiFiAPIdleTimeoutMS(); void _SetWiFiAPIdleTimeoutMS(uint32_t val); CHIP_ERROR _GetAndLogWifiStatsCounters(); - CHIP_ERROR _GetEthPacketRxCount(uint64_t & packetRxCount); - CHIP_ERROR _GetEthPacketTxCount(uint64_t & packetTxCount); - CHIP_ERROR _GetEthTxErrCount(uint64_t & txErrCount); - CHIP_ERROR _GetEthCollisionCount(uint64_t & collisionCount); - CHIP_ERROR _GetEthOverrunCount(uint64_t & overrunCount); bool _CanStartWiFiScan(); void _OnWiFiScanDone(); void _OnWiFiStationProvisionChange(); @@ -186,36 +181,6 @@ template inline void GenericConnectivityManagerImpl_WiFi::_OnWiFiStationProvisionChange() {} -template -inline CHIP_ERROR GenericConnectivityManagerImpl_WiFi::_GetEthPacketRxCount(uint64_t & packetRxCount) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} - -template -inline CHIP_ERROR GenericConnectivityManagerImpl_WiFi::_GetEthPacketTxCount(uint64_t & packetTxCount) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} - -template -inline CHIP_ERROR GenericConnectivityManagerImpl_WiFi::_GetEthTxErrCount(uint64_t & txErrCount) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} - -template -inline CHIP_ERROR GenericConnectivityManagerImpl_WiFi::_GetEthCollisionCount(uint64_t & collisionCount) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} - -template -inline CHIP_ERROR GenericConnectivityManagerImpl_WiFi::_GetEthOverrunCount(uint64_t & overrunCount) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} - } // namespace Internal } // namespace DeviceLayer } // namespace chip