This repository was archived by the owner on Dec 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
src/adaptations/device-layer/include/Weave/DeviceLayer/internal Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change 2929#include < Weave/DeviceLayer/internal/GenericConnectivityManagerImpl_Thread.h>
3030#include < Warm/Warm.h>
3131
32- #if WARM_CONFIG_SUPPORT_THREAD_ROUTING
33- #include < openthread/thread.h>
34- #endif // WARM_CONFIG_SUPPORT_THREAD_ROUTING
35-
3632namespace nl {
3733namespace Weave {
3834namespace DeviceLayer {
@@ -72,14 +68,8 @@ void GenericConnectivityManagerImpl_Thread<ImplClass>::_OnPlatformEvent(const We
7268 event->ThreadStateChange .RoleChanged );
7369 if (threadRoleChanged)
7470 {
75- otDeviceRole role;
76- ThreadStackMgrImpl ().LockThreadStack ();
77- role = otThreadGetDeviceRole (ThreadStackMgrImpl ().OTInstance ());
78- ThreadStackMgrImpl ().UnlockThreadStack ();
79-
80- bool isThreadRouter = (role == OT_DEVICE_ROLE_LEADER || role == OT_DEVICE_ROLE_ROUTER);
81-
82- nl::Weave::Warm::InterfaceState interfaceState = isThreadRouter
71+ ConnectivityManager::ThreadDeviceType deviceType = ThreadStackMgr ().GetThreadDeviceType ();
72+ nl::Weave::Warm::InterfaceState interfaceState = (deviceType == ConnectivityManager::ThreadDeviceType::kThreadDeviceType_Router )
8373 ? nl::Weave::Warm::kInterfaceStateUp
8474 : nl::Weave::Warm::kInterfaceStateDown ;
8575 Warm::ThreadRoutingStateChange (interfaceState);
You can’t perform that action at this time.
0 commit comments