Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[icd] Removed ICD related methods (former SED) from NoThreadImpl #145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions examples/light-switch-app/nrfconnect/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ config CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT

endif # NET_L2_OPENTHREAD

if CHIP_WIFI

config NRF_WIFI_LOW_POWER
default y

endif # CHIP_WIFI

rsource "../../../config/nrfconnect/chip-module/Kconfig.features"
rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults"
source "Kconfig.zephyr"
7 changes: 7 additions & 0 deletions examples/lock-app/nrfconnect/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ config CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT

endif # NET_L2_OPENTHREAD

if CHIP_WIFI

config NRF_WIFI_LOW_POWER
default y

endif # CHIP_WIFI

rsource "../../../config/nrfconnect/chip-module/Kconfig.features"
rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults"
source "Kconfig.zephyr"
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ class GenericConnectivityManagerImpl_NoThread
bool _IsThreadApplicationControlled(void);
ConnectivityManager::ThreadDeviceType _GetThreadDeviceType(void);
CHIP_ERROR _SetThreadDeviceType(ConnectivityManager::ThreadDeviceType deviceType);
CHIP_ERROR _GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig);
CHIP_ERROR _SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig);
CHIP_ERROR _RequestSEDActiveMode(bool onOff, bool delayIdle = false);
bool _IsThreadAttached(void);
bool _IsThreadProvisioned(void);
void _ErasePersistentInfo(void);
Expand Down Expand Up @@ -115,26 +112,6 @@ GenericConnectivityManagerImpl_NoThread<ImplClass>::_SetThreadDeviceType(Connect
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_NoThread<ImplClass>::_GetSEDIntervalsConfig(
ConnectivityManager::SEDIntervalsConfig & intervalsConfig)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_NoThread<ImplClass>::_SetSEDIntervalsConfig(
const ConnectivityManager::SEDIntervalsConfig & intervalsConfig)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_NoThread<ImplClass>::_RequestSEDActiveMode(bool onOff, bool delayIdle)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline void GenericConnectivityManagerImpl_NoThread<ImplClass>::_ResetThreadNetworkDiagnosticsCounts()
{}
Expand Down
4 changes: 4 additions & 0 deletions src/platform/nrfconnect/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@
#define CHIP_DEVICE_CONFIG_THREAD_SSED CONFIG_CHIP_THREAD_SSED
#endif // CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT

#ifdef CONFIG_NRF_WIFI_LOW_POWER
#define CHIP_DEVICE_CONFIG_ENABLE_SED 1
#endif // CONFIG_NRF_WIFI_LOW_POWER

#ifndef CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL
#ifdef CONFIG_CHIP_SED_IDLE_INTERVAL
#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_SED_IDLE_INTERVAL)
Expand Down
20 changes: 20 additions & 0 deletions src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,26 @@ CHIP_ERROR ConnectivityManagerImplWiFi::_GetAndLogWiFiStatsCounters(void)
return CHIP_NO_ERROR;
}

#if CHIP_DEVICE_CONFIG_ENABLE_SED
CHIP_ERROR ConnectivityManagerImplWiFi::_GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & SEDIntervalsConfig)
{
// For now Wi-Fi uses legacy power save mode that has fixed inactivity interval
SEDIntervalsConfig.ActiveIntervalMS =
chip::System::Clock::Milliseconds32(WiFiManager::kDefaultDTIMInterval * WiFiManager::kBeaconIntervalMs);
SEDIntervalsConfig.IdleIntervalMS =
chip::System::Clock::Milliseconds32(WiFiManager::kDefaultDTIMInterval * WiFiManager::kBeaconIntervalMs);
return CHIP_NO_ERROR;
}
CHIP_ERROR ConnectivityManagerImplWiFi::_SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}
CHIP_ERROR ConnectivityManagerImplWiFi::_RequestSEDActiveMode(bool onOff, bool delayIdle)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}
#endif

ConnectivityManager::WiFiAPMode ConnectivityManagerImplWiFi::_GetWiFiAPMode(void)
{
/* AP mode is unsupported */
Expand Down
6 changes: 6 additions & 0 deletions src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ class ConnectivityManagerImplWiFi
void _OnWiFiScanDone();
void _OnWiFiStationProvisionChange();

#if CHIP_DEVICE_CONFIG_ENABLE_SED
CHIP_ERROR _GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig);
CHIP_ERROR _SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig);
CHIP_ERROR _RequestSEDActiveMode(bool onOff, bool delayIdle = false);
#endif

// Wi-Fi access point - not supported
ConnectivityManager::WiFiAPMode _GetWiFiAPMode(void);
CHIP_ERROR _SetWiFiAPMode(ConnectivityManager::WiFiAPMode val);
Expand Down
5 changes: 5 additions & 0 deletions src/platform/nrfconnect/wifi/WiFiManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ class WiFiManager
static constexpr uint16_t kMaxInitialRouterSolicitationDelayMs = 1000;
static constexpr uint8_t kRouterSolicitationMaxCount = 3;

#if CHIP_DEVICE_CONFIG_ENABLE_SED
static constexpr uint8_t kDefaultDTIMInterval = 3;
static constexpr uint8_t kBeaconIntervalMs = 100;
#endif

CHIP_ERROR Init();
CHIP_ERROR Scan(const ByteSpan & ssid, ScanResultCallback resultCallback, ScanDoneCallback doneCallback,
bool internalScan = false);
Expand Down