@@ -41,7 +41,6 @@ namespace {
41
41
42
42
constexpr uint8_t kWlanMinRetryIntervalsInSec = 1 ;
43
43
constexpr uint8_t kWlanMaxRetryIntervalsInSec = 60 ;
44
- constexpr uint8_t kWlanRetryIntervalInSec = 5 ;
45
44
uint8_t retryInterval = kWlanMinRetryIntervalsInSec ;
46
45
osTimerId_t sRetryTimer ;
47
46
@@ -52,7 +51,7 @@ osTimerId_t sRetryTimer;
52
51
void RetryConnectionTimerHandler (void * arg)
53
52
{
54
53
#if CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE
55
- wfx_rsi_power_save (RSI_ACTIVE, HIGH_PERFORMANCE);
54
+ wfx_power_save (RSI_ACTIVE, HIGH_PERFORMANCE);
56
55
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE
57
56
if (wfx_connect_to_ap () != SL_STATUS_OK)
58
57
{
@@ -178,54 +177,23 @@ void wfx_ip_changed_notify(int got_ip)
178
177
*************************************************************************************/
179
178
void wfx_retry_connection (uint16_t retryAttempt)
180
179
{
181
- // During commissioning, we retry to join the network MAX_JOIN_RETRIES_COUNT
182
- if (/* BaseApplication::sAppDelegate.isCommissioningInProgress()*/ true )
180
+ if (retryInterval > kWlanMaxRetryIntervalsInSec )
183
181
{
184
- if (retryAttempt < MAX_JOIN_RETRIES_COUNT)
185
- {
186
- ChipLogProgress (DeviceLayer, " wfx_retry_connection : Next attempt after %d Seconds" , kWlanRetryIntervalInSec );
187
- if (osTimerStart (sRetryTimer , pdMS_TO_TICKS (CONVERT_SEC_TO_MS (kWlanRetryIntervalInSec ))) != osOK)
188
- {
189
- ChipLogProgress (DeviceLayer, " Failed to start retry timer" );
190
- // Sending the join command if retry timer failed to start
191
- if (wfx_connect_to_ap () != SL_STATUS_OK)
192
- {
193
- ChipLogError (DeviceLayer, " wfx_connect_to_ap() failed." );
194
- }
195
- return ;
196
- }
197
- }
198
- else
199
- {
200
- ChipLogProgress (DeviceLayer, " Connect failed after max %d tries" , retryAttempt);
201
- }
182
+ retryInterval = kWlanMaxRetryIntervalsInSec ;
202
183
}
203
- else
184
+ if ( osTimerStart ( sRetryTimer , pdMS_TO_TICKS ( CONVERT_SEC_TO_MS (retryInterval))) != osOK)
204
185
{
205
- /* After disconnection or power cycle the DUT
206
- * At the telescopic time interval device try to reconnect with AP, upto WLAN_MAX_RETRY_TIMER_MS intervals
207
- * are telescopic. If interval exceed WLAN_MAX_RETRY_TIMER_MS then it will try to reconnect at
208
- * WLAN_MAX_RETRY_TIMER_MS intervals.
209
- */
210
- if (retryInterval > kWlanMaxRetryIntervalsInSec )
211
- {
212
- retryInterval = kWlanMaxRetryIntervalsInSec ;
213
- }
214
- if (osTimerStart (sRetryTimer , pdMS_TO_TICKS (CONVERT_SEC_TO_MS (retryInterval))) != osOK)
186
+ ChipLogProgress (DeviceLayer, " Failed to start retry timer" );
187
+ // Sending the join command if retry timer failed to start
188
+ if (wfx_connect_to_ap () != SL_STATUS_OK)
215
189
{
216
- ChipLogProgress (DeviceLayer, " Failed to start retry timer" );
217
- // Sending the join command if retry timer failed to start
218
- if (wfx_connect_to_ap () != SL_STATUS_OK)
219
- {
220
- ChipLogError (DeviceLayer, " wfx_connect_to_ap() failed." );
221
- }
222
- return ;
190
+ ChipLogError (DeviceLayer, " wfx_connect_to_ap() failed." );
223
191
}
224
- #if CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE
225
- wfx_rsi_power_save (RSI_SLEEP_MODE_8, STANDBY_POWER_SAVE_WITH_RAM_RETENTION);
226
- #endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE
227
- ChipLogProgress (DeviceLayer, " wfx_retry_connection : Next attempt after %d Seconds" , retryInterval);
228
- retryInterval += retryInterval;
229
192
return ;
230
193
}
194
+ #if CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE
195
+ wfx_power_save (RSI_SLEEP_MODE_8, STANDBY_POWER_SAVE_WITH_RAM_RETENTION);
196
+ #endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE
197
+ ChipLogProgress (DeviceLayer, " wfx_retry_connection : Next attempt after %d Seconds" , retryInterval);
198
+ retryInterval += retryInterval;
231
199
}
0 commit comments