Skip to content

Commit f2b161e

Browse files
committed
fixing the build and replacing the define
1 parent 2f75be5 commit f2b161e

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

examples/platform/silabs/BaseApplication.h

+3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ class BaseApplicationDelegate : public AppDelegate, public chip::FabricTable::De
7272
// AppDelegate
7373
bool isComissioningStarted = false;
7474
void OnCommissioningSessionStarted() override;
75+
void OnCommissioningSessionStopped() override;
76+
void OnCommissioningWindowClosed() override;
77+
7578
// FabricTable::Delegate
7679
void OnFabricCommitted(const chip::FabricTable & fabricTable, chip::FabricIndex fabricIndex) override;
7780
void OnFabricRemoved(const chip::FabricTable & fabricTable, chip::FabricIndex fabricIndex) override;

examples/platform/silabs/wifi/wfx_notify.cpp

+12-9
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <stdio.h>
1919
#include <stdlib.h>
2020
#include <string.h>
21-
#include <icd/server/ICDServerConfig.h>
21+
#include <app/icd/server/ICDServerConfig.h>
2222
#include "AppConfig.h"
2323
#include "BaseApplication.h"
2424

@@ -38,7 +38,10 @@ using namespace ::chip;
3838
using namespace ::chip::DeviceLayer;
3939

4040
namespace {
41-
uint16_t retryInterval = WLAN_MIN_RETRY_TIMER_MS;
41+
constexpr uint8_t kWlanMinRetryIntervalsInSec = 1;
42+
constexpr uint8_t kWlanMaxRetryIntervalsInSec = 60;
43+
constexpr uint8_t kWlanRetryIntervalInSec = 5;
44+
uint8_t retryInterval = kWlanMinRetryIntervalsInSec;
4245
osTimerId_t sRetryTimer;
4346
}
4447
/*
@@ -70,7 +73,7 @@ void wfx_started_notify()
7073

7174
// Creating a timer which will be used to retry connection with AP
7275
sRetryTimer = osTimerNew(RetryConnectionTimerHandler, osTimerOnce, NULL, NULL);
73-
VerifyOrReturnError(sRetryTimer != NULL, SL_STATUS_ALLOCATION_FAILED);
76+
VerifyOrReturn(sRetryTimer != NULL);
7477

7578
memset(&evt, 0, sizeof(evt));
7679
evt.header.id = SL_WFX_STARTUP_IND_ID;
@@ -182,8 +185,8 @@ void wfx_retry_connection(uint16_t retryAttempt)
182185
if (retryAttempt < MAX_JOIN_RETRIES_COUNT)
183186
{
184187
ChipLogProgress(DeviceLayer, "wfx_retry_connection : Next attempt after %d Seconds",
185-
CONVERT_MS_TO_SEC(WLAN_RETRY_TIMER_MS));
186-
if (osTimerStart(sRetryTimer, pdMS_TO_TICKS(WLAN_RETRY_TIMER_MS)) != osOK)
188+
kWlanRetryIntervalInSec);
189+
if (osTimerStart(sRetryTimer, pdMS_TO_TICKS(CONVERT_SEC_TO_MS(kWlanRetryIntervalInSec))) != osOK)
187190
{
188191
ChipLogProgress(DeviceLayer, "Failed to start retry timer");
189192
// Sending the join command if retry timer failed to start
@@ -205,11 +208,11 @@ void wfx_retry_connection(uint16_t retryAttempt)
205208
* are telescopic. If interval exceed WLAN_MAX_RETRY_TIMER_MS then it will try to reconnect at
206209
* WLAN_MAX_RETRY_TIMER_MS intervals.
207210
*/
208-
if (retryInterval > WLAN_MAX_RETRY_TIMER_MS)
211+
if (retryInterval > kWlanMaxRetryIntervalsInSec)
209212
{
210-
retryInterval = WLAN_MAX_RETRY_TIMER_MS;
213+
retryInterval = kWlanMaxRetryIntervalsInSec;
211214
}
212-
if (osTimerStart(sRetryTimer, pdMS_TO_TICKS(retryInterval)) != osOK)
215+
if (osTimerStart(sRetryTimer, pdMS_TO_TICKS(CONVERT_SEC_TO_MS(retryInterval))) != osOK)
213216
{
214217
ChipLogProgress(DeviceLayer, "Failed to start retry timer");
215218
// Sending the join command if retry timer failed to start
@@ -221,7 +224,7 @@ void wfx_retry_connection(uint16_t retryAttempt)
221224
#if CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE
222225
wfx_rsi_power_save(RSI_SLEEP_MODE_8, STANDBY_POWER_SAVE_WITH_RAM_RETENTION);
223226
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE
224-
ChipLogProgress(DeviceLayer, "wfx_retry_connection : Next attempt after %d Seconds", CONVERT_MS_TO_SEC(retryInterval));
227+
ChipLogProgress(DeviceLayer, "wfx_retry_connection : Next attempt after %d Seconds", retryInterval);
225228
retryInterval += retryInterval;
226229
return;
227230
}

src/platform/silabs/SiWx917/wifi/wfx_host_events.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,7 @@
6060
#define BLE_DRIVER_TASK_PRIORITY (2)
6161
#define MAX_JOIN_RETRIES_COUNT (5)
6262

63-
// WLAN retry time intervals in milli seconds
64-
#define WLAN_MAX_RETRY_TIMER_MS 60000
65-
#define WLAN_MIN_RETRY_TIMER_MS 1000
66-
#define WLAN_RETRY_TIMER_MS 5000
67-
#define CONVERT_MS_TO_SEC(TimeInMS) (TimeInMS / 1000)
63+
#define CONVERT_SEC_TO_MS(TimeInS) (TimeInS * 1000)
6864

6965
// WLAN related Macros
7066
#define ETH_FRAME (0)

src/platform/silabs/efr32/wifi/wfx_host_events.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,7 @@ typedef struct __attribute__((__packed__)) sl_wfx_mib_req_s
150150
// MAX PASSKEY LENGTH including NULL character
151151
#define WFX_MAX_PASSKEY_LENGTH (64)
152152

153-
// WLAN retry time intervals in milli seconds
154-
#define WLAN_MAX_RETRY_TIMER_MS 60000
155-
#define WLAN_MIN_RETRY_TIMER_MS 1000
156-
#define WLAN_RETRY_TIMER_MS 5000
157-
#define CONVERT_MS_TO_SEC(TimeInMS) (TimeInMS / 1000)
153+
#define CONVERT_SEC_TO_MS(TimeInS) (TimeInMS * 1000)
158154

159155
// WLAN MAX retry
160156
#define MAX_JOIN_RETRIES_COUNT 5

0 commit comments

Comments
 (0)