Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs committed Nov 18, 2024
1 parent ea7c91e commit ca7e2c8
Show file tree
Hide file tree
Showing 13 changed files with 326 additions and 328 deletions.
5 changes: 0 additions & 5 deletions examples/platform/silabs/SiWx917/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@ source_set("siwx917-common") {
}
}

# Sl-Only: Support for the Wi-Fi Sleep Manager
if (chip_enable_icd_server) {
public_deps += [ "${silabs_common_plat_dir}/wifi/icd:sleep-manager" ]
}

# DIC
if (enable_dic) {
public_deps +=
Expand Down
4 changes: 0 additions & 4 deletions examples/platform/silabs/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,6 @@ source_set("efr32-common") {
]
}

if (chip_enable_icd_server && use_SiWx917) {
public_deps += [ "${silabs_common_plat_dir}/wifi/icd:sleep-manager" ]
}

if (app_data_model != "") {
public_deps += [ app_data_model ]
}
Expand Down
134 changes: 0 additions & 134 deletions examples/platform/silabs/wifi/icd/SleepManager.cpp

This file was deleted.

112 changes: 0 additions & 112 deletions examples/platform/silabs/wifi/icd/SleepManager.h

This file was deleted.

5 changes: 0 additions & 5 deletions src/platform/silabs/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@
#define CHIP_DEVICE_CONFIG_ENABLE_IPV4 0
#endif /* CHIP_DEVICE_CONFIG_ENABLE_IPV4 */

#if SL_ICD_ENABLED
#define CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL chip::System::Clock::Milliseconds32(300)
#define CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL chip::System::Clock::Milliseconds32(10)
#endif /* SL_ICD_ENABLED */

#endif /* SL_WIFI */

// ========== Platform-specific Configuration =========
Expand Down
38 changes: 11 additions & 27 deletions src/platform/silabs/SiWx917/OTAImageProcessorImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#include <app/clusters/ota-requestor/OTADownloader.h>
#include <app/clusters/ota-requestor/OTARequestorInterface.h>
#include <platform/silabs/OTAImageProcessorImpl.h>

#include <platform/silabs/SilabsConfig.h>
#include <platform/silabs/wifi/WifiInterfaceAbstraction.h>
#include <platform/silabs/wifi/icd/PlatformSleepManager.h>

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -157,13 +157,9 @@ void OTAImageProcessorImpl::HandlePrepareDownload(intptr_t context)

imageProcessor->mHeaderParser.Init();

// Setting the device is in high performace - no-sleepy mode while OTA tranfer
#if (CHIP_CONFIG_ENABLE_ICD_SERVER)
status = wfx_power_save(RSI_ACTIVE, HIGH_PERFORMANCE);
if (status != SL_STATUS_OK)
{
ChipLogError(DeviceLayer, "Failed to enable the TA Deep Sleep");
}
#if CHIP_CONFIG_ENABLE_ICD_SERVER
// Setting the device is in high performace - no-sleepy mode during OTA tranfer
DeviceLayer::Silabs::PlatformSleepManager::GetInstance().RequestHighPerformance();
#endif /* CHIP_CONFIG_ENABLE_ICD_SERVER*/

imageProcessor->mDownloader->OnPreparedForDownload(CHIP_NO_ERROR);
Expand Down Expand Up @@ -200,13 +196,9 @@ void OTAImageProcessorImpl::HandleFinalize(intptr_t context)
}
imageProcessor->ReleaseBlock();

// Setting the device back to power save mode when transfer is completed successfully
#if (CHIP_CONFIG_ENABLE_ICD_SERVER)
sl_status_t err = wfx_power_save(RSI_SLEEP_MODE_2, ASSOCIATED_POWER_SAVE);
if (err != SL_STATUS_OK)
{
ChipLogError(DeviceLayer, "Power save config for Wifi failed");
}
// Setting the device back to power save mode when transfer is completed successfully
DeviceLayer::Silabs::PlatformSleepManager::GetInstance().RemoveHighPerformanceRequest();
#endif /* CHIP_CONFIG_ENABLE_ICD_SERVER*/

ChipLogProgress(SoftwareUpdate, "OTA image downloaded successfully");
Expand All @@ -223,13 +215,9 @@ void OTAImageProcessorImpl::HandleApply(intptr_t context)

ChipLogProgress(SoftwareUpdate, "OTA image downloaded successfully in HandleApply");

#if CHIP_CONFIG_ENABLE_ICD_SERVER
// Setting the device is in high performace - no-sleepy mode before soft reset as soft reset is not happening in sleep mode
#if (CHIP_CONFIG_ENABLE_ICD_SERVER)
status = wfx_power_save(RSI_ACTIVE, HIGH_PERFORMANCE);
if (status != SL_STATUS_OK)
{
ChipLogError(DeviceLayer, "Failed to enable the TA Deep Sleep");
}
DeviceLayer::Silabs::PlatformSleepManager::GetInstance().RequestHighPerformance();
#endif /* CHIP_CONFIG_ENABLE_ICD_SERVER*/

if (mReset)
Expand All @@ -250,13 +238,9 @@ void OTAImageProcessorImpl::HandleAbort(intptr_t context)
return;
}

#if CHIP_CONFIG_ENABLE_ICD_SERVER
// Setting the device back to power save mode when transfer is aborted in the middle
#if (CHIP_CONFIG_ENABLE_ICD_SERVER)
sl_status_t err = wfx_power_save(RSI_SLEEP_MODE_2, ASSOCIATED_POWER_SAVE);
if (err != SL_STATUS_OK)
{
ChipLogError(DeviceLayer, "Power save config for Wifi failed");
}
DeviceLayer::Silabs::PlatformSleepManager::GetInstance().RemoveHighPerformanceRequest();
#endif /* CHIP_CONFIG_ENABLE_ICD_SERVER*/

// Not clearing the image storage area as it is done during each write
Expand Down
10 changes: 10 additions & 0 deletions src/platform/silabs/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,16 @@ static_library("efr32") {
"${silabs_platform_dir}/NetworkCommissioningWiFiDriver.h",
]

# [sl-only] Support for the Wi-Fi Sleep Manager
if (chip_enable_icd_server) {
public_deps += [ "${silabs_common_plat_dir}/wifi/icd:sleep-manager" ]
}

# [sl-only] Support for the Wi-Fi Sleep Manager
public_deps += [ "${silabs_platform_dir}/wifi:wifi-platform" ]

if (chip_enable_icd_server && use_SiWx917) {
public_deps += [ "${silabs_common_plat_dir}/wifi/icd:sleep-manager" ]
}
}
}
Loading

0 comments on commit ca7e2c8

Please sign in to comment.