Remove RAM buffers for local operational datasets. (#1929)

The local Active and Pending Operational Datsets are stored in non-volatile
memory.  This commit dynamically retrieves those datasets from non-volatile
memory when they are needed.

This commit also simplifies the use of the Operational Datasets by having the
RAM buffer store the local Operational Dataset when in the detached state.
This commit is contained in:
Jonathan Hui
2017-07-05 09:41:08 -07:00
committed by GitHub
parent bbab3074ed
commit 0d27c3e00b
22 changed files with 1321 additions and 495 deletions
+8 -8
View File
@@ -75,8 +75,8 @@ otError otThreadSetExtendedPanId(otInstance *aInstance, const uint8_t *aExtended
mlPrefix[7] = 0x00;
aInstance->mThreadNetif.GetMle().SetMeshLocalPrefix(mlPrefix);
aInstance->mThreadNetif.GetActiveDataset().Clear(false);
aInstance->mThreadNetif.GetPendingDataset().Clear(false);
aInstance->mThreadNetif.GetActiveDataset().Clear();
aInstance->mThreadNetif.GetPendingDataset().Clear();
exit:
return error;
@@ -165,8 +165,8 @@ otError otThreadSetMasterKey(otInstance *aInstance, const otMasterKey *aKey)
error = OT_ERROR_INVALID_STATE);
error = aInstance->mThreadNetif.GetKeyManager().SetMasterKey(*aKey);
aInstance->mThreadNetif.GetActiveDataset().Clear(false);
aInstance->mThreadNetif.GetPendingDataset().Clear(false);
aInstance->mThreadNetif.GetActiveDataset().Clear();
aInstance->mThreadNetif.GetPendingDataset().Clear();
exit:
return error;
@@ -190,8 +190,8 @@ otError otThreadSetMeshLocalPrefix(otInstance *aInstance, const uint8_t *aMeshLo
error = OT_ERROR_INVALID_STATE);
error = aInstance->mThreadNetif.GetMle().SetMeshLocalPrefix(aMeshLocalPrefix);
aInstance->mThreadNetif.GetActiveDataset().Clear(false);
aInstance->mThreadNetif.GetPendingDataset().Clear(false);
aInstance->mThreadNetif.GetActiveDataset().Clear();
aInstance->mThreadNetif.GetPendingDataset().Clear();
exit:
return error;
@@ -215,8 +215,8 @@ otError otThreadSetNetworkName(otInstance *aInstance, const char *aNetworkName)
error = OT_ERROR_INVALID_STATE);
error = aInstance->mThreadNetif.GetMac().SetNetworkName(aNetworkName);
aInstance->mThreadNetif.GetActiveDataset().Clear(false);
aInstance->mThreadNetif.GetPendingDataset().Clear(false);
aInstance->mThreadNetif.GetActiveDataset().Clear();
aInstance->mThreadNetif.GetPendingDataset().Clear();
exit:
return error;