Skip to content

Commit

Permalink
Move ethernet diagnostic APIs to GenericConnectivityManagerImpl (#9727)
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca authored Sep 15, 2021
1 parent 345e332 commit aef5db4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 70 deletions.
36 changes: 36 additions & 0 deletions src/include/platform/internal/GenericConnectivityManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<ImplClass *>(this); }
};
Expand All @@ -71,6 +77,36 @@ template <class ImplClass>
inline void GenericConnectivityManagerImpl<ImplClass>::_SetUserSelectedModeTimeout(uint16_t val)
{}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl<ImplClass>::_GetEthPacketRxCount(uint64_t & packetRxCount)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl<ImplClass>::_GetEthPacketTxCount(uint64_t & packetTxCount)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl<ImplClass>::_GetEthTxErrCount(uint64_t & txErrCount)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl<ImplClass>::_GetEthCollisionCount(uint64_t & collisionCount)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl<ImplClass>::_GetEthOverrunCount(uint64_t & overrunCount)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

} // namespace Internal
} // namespace DeviceLayer
} // namespace chip
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -240,36 +235,6 @@ inline const char * GenericConnectivityManagerImpl_NoWiFi<ImplClass>::_WiFiAPSta
return NULL;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_NoWiFi<ImplClass>::_GetEthPacketRxCount(uint64_t & packetRxCount)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_NoWiFi<ImplClass>::_GetEthPacketTxCount(uint64_t & packetTxCount)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_NoWiFi<ImplClass>::_GetEthTxErrCount(uint64_t & txErrCount)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_NoWiFi<ImplClass>::_GetEthCollisionCount(uint64_t & collisionCount)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_NoWiFi<ImplClass>::_GetEthOverrunCount(uint64_t & overrunCount)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

} // namespace Internal
} // namespace DeviceLayer
} // namespace chip
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -186,36 +181,6 @@ template <class ImplClass>
inline void GenericConnectivityManagerImpl_WiFi<ImplClass>::_OnWiFiStationProvisionChange()
{}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_WiFi<ImplClass>::_GetEthPacketRxCount(uint64_t & packetRxCount)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_WiFi<ImplClass>::_GetEthPacketTxCount(uint64_t & packetTxCount)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_WiFi<ImplClass>::_GetEthTxErrCount(uint64_t & txErrCount)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_WiFi<ImplClass>::_GetEthCollisionCount(uint64_t & collisionCount)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_WiFi<ImplClass>::_GetEthOverrunCount(uint64_t & overrunCount)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

} // namespace Internal
} // namespace DeviceLayer
} // namespace chip

0 comments on commit aef5db4

Please sign in to comment.