@@ -64,14 +64,12 @@ CHIP_ERROR WifiSleepManager::VerifyAndTransitionToLowPowerMode()
64
64
#if SLI_SI917 // 917 SoC & NCP
65
65
if (mHighPerformanceRequestCounter > 0 )
66
66
{
67
- VerifyOrReturnError (ConfigureHighPerformance () == SL_STATUS_OK, CHIP_ERROR_INTERNAL);
68
- return CHIP_NO_ERROR;
67
+ return ConfigureHighPerformance ();
69
68
}
70
69
71
70
if (mIsCommissioningInProgress )
72
71
{
73
- VerifyOrReturnError (ConfigureDTIMBasedSleep () == SL_STATUS_OK, CHIP_ERROR_INTERNAL);
74
- return CHIP_NO_ERROR;
72
+ return ConfigureDTIMBasedSleep ();
75
73
}
76
74
77
75
// TODO: Clean this up when the Wi-Fi interface re-work is finished
@@ -80,63 +78,51 @@ CHIP_ERROR WifiSleepManager::VerifyAndTransitionToLowPowerMode()
80
78
81
79
if (!(wifiConfig.ssid [0 ] != 0 ))
82
80
{
83
- VerifyOrReturnError (ConfigurePowerSave (RSI_SLEEP_MODE_8, DEEP_SLEEP_WITH_RAM_RETENTION, 0 ) == SL_STATUS_OK,
84
- CHIP_ERROR_INTERNAL);
85
- return CHIP_NO_ERROR;
81
+ return ConfigurePowerSave (RSI_SLEEP_MODE_8, DEEP_SLEEP_WITH_RAM_RETENTION, 0 );
86
82
}
87
83
88
84
if (mCallback && mCallback ->CanGoToLIBasedSleep ())
89
85
{
90
- VerifyOrReturnError (ConfigureLIBasedSleep () == SL_STATUS_OK, CHIP_ERROR_INTERNAL);
91
- return CHIP_NO_ERROR;
86
+ return ConfigureLIBasedSleep ();
92
87
}
93
88
94
- VerifyOrReturnError ( ConfigureDTIMBasedSleep () == SL_STATUS_OK, CHIP_ERROR_INTERNAL );
89
+ return ConfigureDTIMBasedSleep ();
95
90
96
91
#elif RS911X_WIFI // rs9116
97
92
VerifyOrReturnError (ConfigurePowerSave () == SL_STATUS_OK, CHIP_ERROR_INTERNAL);
98
- #endif
99
-
100
93
return CHIP_NO_ERROR;
94
+ #endif
101
95
}
102
96
103
97
#if SLI_SI917 // 917 SoC & NCP
104
- sl_status_t WifiSleepManager::ConfigureLIBasedSleep ()
98
+ CHIP_ERROR WifiSleepManager::ConfigureLIBasedSleep ()
105
99
{
106
- sl_status_t status = SL_STATUS_OK;
100
+ VerifyOrReturnError (ConfigurePowerSave (RSI_SLEEP_MODE_2, ASSOCIATED_POWER_SAVE,
101
+ ICDConfigurationData::GetInstance ().GetSlowPollingInterval ().count ()) == SL_STATUS_OK,
102
+ CHIP_ERROR_INTERNAL, ChipLogError (DeviceLayer, " Failed to enable LI based sleep." ));
107
103
108
- status = ConfigurePowerSave (RSI_SLEEP_MODE_2, ASSOCIATED_POWER_SAVE,
109
- ICDConfigurationData::GetInstance ().GetSlowPollingInterval ().count ());
110
- VerifyOrReturnError (status == SL_STATUS_OK, status, ChipLogError (DeviceLayer, " Failed to enable LI based sleep." ));
104
+ VerifyOrReturnError (ConfigureBroadcastFilter (true ) == SL_STATUS_OK, CHIP_ERROR_INTERNAL,
105
+ ChipLogError (DeviceLayer, " Failed to configure broadcasts filter." ));
111
106
112
- status = ConfigureBroadcastFilter (true );
113
- VerifyOrReturnError (status == SL_STATUS_OK, status, ChipLogError (DeviceLayer, " Failed to configure broadcasts filter." ));
114
-
115
- return status;
107
+ return CHIP_NO_ERROR;
116
108
}
117
109
118
- sl_status_t WifiSleepManager::ConfigureDTIMBasedSleep ()
110
+ CHIP_ERROR WifiSleepManager::ConfigureDTIMBasedSleep ()
119
111
{
120
- sl_status_t status = SL_STATUS_OK;
121
-
122
- status = ConfigurePowerSave (RSI_SLEEP_MODE_2, ASSOCIATED_POWER_SAVE, 0 );
123
- VerifyOrReturnError (status == SL_STATUS_OK, status, ChipLogError (DeviceLayer, " Failed to enable to enable DTIM basedsleep." ));
112
+ VerifyOrReturnError (ConfigurePowerSave (RSI_SLEEP_MODE_2, ASSOCIATED_POWER_SAVE, 0 ) == SL_STATUS_OK, CHIP_ERROR_INTERNAL,
113
+ ChipLogError (DeviceLayer, " Failed to enable to enable DTIM basedsleep." ));
124
114
125
- status = ConfigureBroadcastFilter (false );
126
- VerifyOrReturnError (status == SL_STATUS_OK, status, ChipLogError (DeviceLayer, " Failed to configure broadcast filter." ));
115
+ VerifyOrReturnError ( ConfigureBroadcastFilter (false ) == SL_STATUS_OK, CHIP_ERROR_INTERNAL,
116
+ ChipLogError (DeviceLayer, " Failed to configure broadcast filter." ));
127
117
128
- return status ;
118
+ return CHIP_NO_ERROR ;
129
119
}
130
120
131
- sl_status_t WifiSleepManager::ConfigureHighPerformance ()
121
+ CHIP_ERROR WifiSleepManager::ConfigureHighPerformance ()
132
122
{
133
- sl_status_t status = ConfigurePowerSave (RSI_ACTIVE, HIGH_PERFORMANCE, 0 );
134
- if (status != SL_STATUS_OK)
135
- {
136
- ChipLogError (DeviceLayer, " Failed to set Wi-FI configuration to HighPerformance" );
137
- }
138
-
139
- return status;
123
+ VerifyOrReturnError (ConfigurePowerSave (RSI_ACTIVE, HIGH_PERFORMANCE, 0 ) == SL_STATUS_OK, CHIP_ERROR_INTERNAL,
124
+ ChipLogError (DeviceLayer, " Failed to set Wi-FI configuration to HighPerformance." ));
125
+ return CHIP_NO_ERROR;
140
126
}
141
127
#endif // SLI_SI917
142
128
0 commit comments