Function otDatasetSetActive

Source
pub unsafe extern "C" fn otDatasetSetActive(
    aInstance: *mut otInstance,
    aDataset: *const otOperationalDataset,
) -> otError
Expand description

Sets the Active Operational Dataset.

If the dataset does not include an Active Timestamp, the dataset is only partially complete.

If Thread is enabled on a device that has a partially complete Active Dataset, the device will attempt to attach to an existing Thread network using any existing information in the dataset. Only the Thread Network Key is needed to attach to a network.

If channel is not included in the dataset, the device will send MLE Announce messages across different channels to find neighbors on other channels.

If the device successfully attaches to a Thread network, the device will then retrieve the full Active Dataset from its Parent. Note that a router-capable device will not transition to the Router or Leader roles until it has a complete Active Dataset.

This function consistently returns OT_ERROR_NONE and can effectively be treated as having a void return type. Previously, other errors (e.g., OT_ERROR_NOT_IMPLEMENTED) were allowed for legacy reasons. However, as non-volatile storage is now mandatory for Thread operation, any failure to save the dataset will trigger an assertion. The otError return type is retained for backward compatibility.

@param[in] aInstance A pointer to an OpenThread instance. @param[in] aDataset A pointer to the Active Operational Dataset.

@retval OT_ERROR_NONE Successfully set the Active Operational Dataset.