Skip to content

Commit

Permalink
update mStagingNetwork to the dataset in NVS after thread init
Browse files Browse the repository at this point in the history
  • Loading branch information
DejinChen committed Jan 22, 2024
1 parent ed22840 commit ca812cf
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,16 @@ void GenericThreadStackManagerImpl_OpenThread<ImplClass>::_OnPlatformEvent(const
#if CHIP_DETAIL_LOGGING
LogOpenThreadStateChange(mOTInst, event->ThreadStateChange.OpenThread.Flags);
#endif // CHIP_DETAIL_LOGGING

if (event->ThreadStateChange.OpenThread.Flags & OT_CHANGED_ACTIVE_DATASET)
{
char DebugText[CHIP_CONFIG_NETWORK_COMMISSIONING_DEBUG_TEXT_BUFFER_SIZE];
chip::MutableCharSpan DebugSpan(DebugText);
uint8_t outNetworkIndex = 0;
Thread::OperationalDataset dataset;
ReturnOnFailure(ThreadStackMgrImpl().GetThreadProvision(dataset));
sGenericThreadDriver.AddOrUpdateNetwork(dataset.AsByteSpan(), DebugSpan, outNetworkIndex);
}
}
}

Expand Down

0 comments on commit ca812cf

Please sign in to comment.