Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs committed Aug 21, 2023
1 parent 0a81ed7 commit c78843c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
3 changes: 2 additions & 1 deletion examples/light-switch-app/silabs/openthread.gni
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ openthread_external_platform =

# ICD Default configurations
chip_enable_icd_server = true
enable_synchronized_sed = true
chip_subscription_timeout_resumption = false
sl_use_subscription_synching = true

# Openthread Configuration flags
sl_ot_idle_interval_ms = 30000 # 30s Idle Intervals
sl_ot_idle_interval_ms = 500 # 30s Idle Intervals
sl_ot_active_interval_ms = 500 # 500ms Active Intervals

# ICD Matter Configuration flags
Expand Down
3 changes: 2 additions & 1 deletion examples/light-switch-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ void AppTask::AppTaskMain(void * pvParameter)
SILABS_LOG("App Task started");

#if defined(SL_CATALOG_POWER_MANAGER_PRESENT)
// sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1);
SILABS_LOG("----------------------------------------------- ADING EM1 requirement ---------------------------------");
sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1);
#endif

while (true)
Expand Down
8 changes: 6 additions & 2 deletions examples/platform/silabs/MatterConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,18 @@ void SilabsMatterConfig::ConnectivityEventCallback(const ChipDeviceEvent * event
chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(OTAConfig::kInitOTARequestorDelaySec),
InitOTARequestorHandler, nullptr);
#endif

SILABS_LOG("------------------------------------ Send Data Request -------------------------------------")
otLinkSendDataRequest(chip::DeviceLayer::ThreadStackMgrImpl().OTInstance());

}

if (event->Type == DeviceLayer::DeviceEventType::kCommissioningComplete)
{
#if CHIP_ENABLE_OPENTHREAD
#if defined(SL_CATALOG_POWER_MANAGER_PRESENT)
SILABS_LOG("------------------------------------ REMOVE EM REQUIREMENT -------------------------------------")
// sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1);
SILABS_LOG("------------------------------------ REMOVE EM 1 REQUIREMENT -------------------------------------")
sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1);
#endif
#endif // CHIP_ENABLE_OPENTHREAD
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
// Timeout after 2 missed checkin or 4 mins if sleep interval is too short.
#define OPENTHREAD_CONFIG_MLE_CHILD_TIMEOUT_DEFAULT ((SL_MLE_TIMEOUT_s < 120) ? 240 : ((SL_MLE_TIMEOUT_s * 2) + 1))


#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1
#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1
#define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 1

#endif // SL_ICD_ENABLED

/****Uncomment below section for OpenThread Debug logs*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1956,10 +1956,6 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread<ImplClass>::_SetPollingInter
#if CHIP_DEVICE_CONFIG_THREAD_SSED
// Get CSL period in units of 10 symbols, convert it to microseconds and divide by 1000 to get milliseconds.
uint32_t curIntervalMS = otLinkCslGetPeriod(mOTInst) * OT_US_PER_TEN_SYMBOLS / 1000;
ChipLogProgress(DeviceLayer,
"----------------------------------------- SSED interval BEFORE set: %" PRId32
"ms -------------------------------------------------------",
curIntervalMS);
#else
uint32_t curIntervalMS = otLinkGetPollPeriod(mOTInst);
#endif
Expand All @@ -1969,17 +1965,7 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread<ImplClass>::_SetPollingInter
#if CHIP_DEVICE_CONFIG_THREAD_SSED
// Set CSL period in units of 10 symbols, convert it to microseconds and divide by 1000 to get milliseconds.
otErr = otLinkCslSetPeriod(mOTInst, pollingInterval.count() * 1000 / OT_US_PER_TEN_SYMBOLS);
uint32_t temp = pollingInterval.count() * 1000 / OT_US_PER_TEN_SYMBOLS;
ChipLogProgress(DeviceLayer,
"-------------------------------------------------------- SSED interval ASKED VALUE setting to: %" PRId32
" CSL periode -----------------------------------------------------------",
temp);

curIntervalMS = otLinkCslGetPeriod(mOTInst) * OT_US_PER_TEN_SYMBOLS / 1000;
ChipLogProgress(DeviceLayer,
"-------------------------------------------------------- SSED interval AFTER setting to: %" PRId32
"ms -----------------------------------------------------------",
curIntervalMS);
#else
otErr = otLinkSetPollPeriod(mOTInst, pollingInterval.count());
curIntervalMS = otLinkGetPollPeriod(mOTInst);
Expand Down
2 changes: 1 addition & 1 deletion third_party/silabs/efr32_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ declare_args() {
sl_ot_active_interval_ms = 200 # 200ms Active Intervals

# SSED Specific configurations
sl_ot_csl_timeout_sec = 1 # 30s CSL timeout
sl_ot_csl_timeout_sec = 30 # 30s CSL timeout

# ICD Matter Configuration flags
sl_idle_mode_interval_ms = 600000 # 10min Idle Mode Interval
Expand Down

0 comments on commit c78843c

Please sign in to comment.