Skip to content

Commit

Permalink
Reorder error checks in Wi-Fi sleep configuration functions for impro…
Browse files Browse the repository at this point in the history
…ved clarity
  • Loading branch information
rosahay-silabs committed Dec 7, 2024
1 parent 7ecca3f commit 1e4c5d5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/platform/silabs/wifi/icd/WifiSleepManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ namespace {
*/
CHIP_ERROR ConfigureLIBasedSleep()
{
VerifyOrReturnError(ConfigureBroadcastFilter(true) == SL_STATUS_OK, CHIP_ERROR_INTERNAL,
ChipLogError(DeviceLayer, "Failed to configure broadcasts filter."));

VerifyOrReturnError(ConfigurePowerSave(RSI_SLEEP_MODE_2, ASSOCIATED_POWER_SAVE,
chip::ICDConfigurationData::GetInstance().GetSlowPollingInterval().count()) ==
SL_STATUS_OK,
CHIP_ERROR_INTERNAL, ChipLogError(DeviceLayer, "Failed to enable LI based sleep."));

VerifyOrReturnError(ConfigureBroadcastFilter(true) == SL_STATUS_OK, CHIP_ERROR_INTERNAL,
ChipLogError(DeviceLayer, "Failed to configure broadcasts filter."));

return CHIP_NO_ERROR;
}

Expand All @@ -51,12 +51,12 @@ CHIP_ERROR ConfigureLIBasedSleep()
*/
CHIP_ERROR ConfigureDTIMBasedSleep()
{
VerifyOrReturnError(ConfigurePowerSave(RSI_SLEEP_MODE_2, ASSOCIATED_POWER_SAVE, 0) == SL_STATUS_OK, CHIP_ERROR_INTERNAL,
ChipLogError(DeviceLayer, "Failed to enable to enable DTIM basedsleep."));

VerifyOrReturnError(ConfigureBroadcastFilter(false) == SL_STATUS_OK, CHIP_ERROR_INTERNAL,
ChipLogError(DeviceLayer, "Failed to configure broadcast filter."));

VerifyOrReturnError(ConfigurePowerSave(RSI_SLEEP_MODE_2, ASSOCIATED_POWER_SAVE, 0) == SL_STATUS_OK, CHIP_ERROR_INTERNAL,
ChipLogError(DeviceLayer, "Failed to enable to enable DTIM basedsleep."));

return CHIP_NO_ERROR;
}

Expand Down

0 comments on commit 1e4c5d5

Please sign in to comment.