Skip to content

Commit

Permalink
Revert "[Telink] Move SetRouterPromotion(false) at the end of OpenCom…
Browse files Browse the repository at this point in the history
…missioningWindow (project-chip#25517)"

This reverts commit 37c3db9.
  • Loading branch information
woody-apple committed Aug 23, 2023
1 parent 1439ad4 commit 50df587
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/app/server/CommissioningWindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,17 +249,6 @@ CHIP_ERROR CommissioningWindowManager::OpenCommissioningWindow(Seconds16 commiss

mCommissioningTimeoutTimerArmed = true;

#if CHIP_DEVICE_CONFIG_ENABLE_THREAD && CHIP_DEVICE_CONFIG_THREAD_FTD
// Block device role changing into Router if commissioning window opened and device not yet Router.
// AdvertiseAndListenForPASE fails doesn't matter, because if it does the callers of OpenCommissioningWindow
// will end up calling ResetState, which will reset the boolean.
if (ConnectivityManagerImpl().GetThreadDeviceType() == ConnectivityManager::kThreadDeviceType_Router)
{
ThreadStackMgr().SetRouterPromotion(false);
mRecoverRouterDeviceRole = true;
}
#endif

return AdvertiseAndListenForPASE();
}

Expand Down Expand Up @@ -496,6 +485,15 @@ CHIP_ERROR CommissioningWindowManager::StartAdvertisement()
// reset all advertising, switching to our new commissioning mode.
app::DnssdServer::Instance().StartServer();

#if CHIP_DEVICE_CONFIG_ENABLE_THREAD && CHIP_DEVICE_CONFIG_THREAD_FTD
// Block device role changing into Router if commissioning window opened and device not yet Router.
if (ConnectivityManagerImpl().GetThreadDeviceType() == ConnectivityManager::kThreadDeviceType_Router)
{
ThreadStackMgr().SetRouterPromotion(false);
mRecoverRouterDeviceRole = true;
}
#endif

return CHIP_NO_ERROR;
}

Expand Down

0 comments on commit 50df587

Please sign in to comment.