Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenThread] Improve OpenThread SED polling logs #23780

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1833,23 +1833,30 @@ GenericThreadStackManagerImpl_OpenThread<ImplClass>::SetSEDIntervalMode(Connecti
#else
uint32_t curIntervalMS = otLinkGetPollPeriod(mOTInst);
#endif

otError otErr = OT_ERROR_NONE;
if (interval.count() != curIntervalMS)
{
#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.
otError otErr = otLinkCslSetPeriod(mOTInst, interval.count() * 1000 / OT_US_PER_TEN_SYMBOLS);
otErr = otLinkCslSetPeriod(mOTInst, interval.count() * 1000 / OT_US_PER_TEN_SYMBOLS);
curIntervalMS = otLinkCslGetPeriod(mOTInst) * OT_US_PER_TEN_SYMBOLS / 1000;
#else
otError otErr = otLinkSetPollPeriod(mOTInst, interval.count());
otErr = otLinkSetPollPeriod(mOTInst, interval.count());
curIntervalMS = otLinkGetPollPeriod(mOTInst);
#endif
err = MapOpenThreadError(otErr);
}

Impl()->UnlockThreadStack();

if (interval.count() != curIntervalMS)
if (otErr != OT_ERROR_NONE)
{
ChipLogError(DeviceLayer, "Failed to set SED interval to %" PRId32 "ms. Defaulting to %" PRId32 "ms", interval.count(),
curIntervalMS);
}
else
{
ChipLogProgress(DeviceLayer, "OpenThread SED interval set to %" PRId32 "ms", interval.count());
ChipLogProgress(DeviceLayer, "OpenThread SED interval is %" PRId32 "ms", curIntervalMS);
}

return err;
Expand Down