mirror of
https://github.com/espressif/openthread.git
synced 2026-07-09 22:00:19 +00:00
Ncp: Fix join existing network feature (#865)
This commit changes the NcpBase and join-existing-network feature by ensuring that the flag `mRequireJoinExistingNetwork` is not cleared when role changes to detached or disabled. This fixes the issue where a "join" command could seemingly succeed with device forming its own partition (e.g, if a wrong network key is used).
This commit is contained in:
committed by
Jonathan Hui
parent
919e902e18
commit
275d22d8d7
+10
-1
@@ -740,7 +740,16 @@ void NcpBase::UpdateChangedProps(void)
|
||||
{
|
||||
if (mRequireJoinExistingNetwork)
|
||||
{
|
||||
mRequireJoinExistingNetwork = false;
|
||||
switch (otGetDeviceRole(mInstance))
|
||||
{
|
||||
case kDeviceRoleDetached:
|
||||
case kDeviceRoleDisabled:
|
||||
break;
|
||||
|
||||
default:
|
||||
mRequireJoinExistingNetwork = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( (otGetDeviceRole(mInstance) == kDeviceRoleLeader)
|
||||
&& otIsSingleton(mInstance)
|
||||
|
||||
Reference in New Issue
Block a user