Move PSKc Get and Set functions to thread_ftd (#1782)

This commit is contained in:
Shu Chen
2017-05-19 11:52:39 +08:00
committed by Jonathan Hui
parent 8899793e61
commit 9bcc2ccfe4
4 changed files with 47 additions and 52 deletions
-21
View File
@@ -149,27 +149,6 @@ ThreadError otThreadSetLinkMode(otInstance *aInstance, otLinkModeConfig aConfig)
return aInstance->mThreadNetif.GetMle().SetDeviceMode(mode);
}
#if OPENTHREAD_FTD
const uint8_t *otThreadGetPSKc(otInstance *aInstance)
{
return aInstance->mThreadNetif.GetKeyManager().GetPSKc();
}
ThreadError otThreadSetPSKc(otInstance *aInstance, const uint8_t *aPSKc)
{
ThreadError error = kThreadError_None;
VerifyOrExit(aInstance->mThreadNetif.GetMle().GetDeviceState() == Mle::kDeviceStateDisabled,
error = kThreadError_InvalidState);
aInstance->mThreadNetif.GetKeyManager().SetPSKc(aPSKc);
aInstance->mThreadNetif.GetActiveDataset().Clear(false);
aInstance->mThreadNetif.GetPendingDataset().Clear(false);
exit:
return error;
}
#endif
const otMasterKey *otThreadGetMasterKey(otInstance *aInstance)
{
return &aInstance->mThreadNetif.GetKeyManager().GetMasterKey();