mirror of
https://github.com/espressif/openthread.git
synced 2026-07-07 04:44:47 +00:00
Move PSKc Get and Set functions to thread_ftd (#1782)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user