openthread_sys

Function otThreadSetNetworkKeyRef

Source
pub unsafe extern "C" fn otThreadSetNetworkKeyRef(
    aInstance: *mut otInstance,
    aKeyRef: otNetworkKeyRef,
) -> otError
Expand description

Set the Thread Network Key as a otNetworkKeyRef.

Succeeds only when Thread protocols are disabled. A successful call to this function invalidates the Active and Pending Operational Datasets in non-volatile memory.

Requires the build-time feature OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE to be enabled.

@param[in] aInstance A pointer to an OpenThread instance. @param[in] aKeyRef Reference to the Thread Network Key.

@retval OT_ERROR_NONE Successfully set the Thread Network Key. @retval OT_ERROR_INVALID_STATE Thread protocols are enabled.

@sa otThreadGetNetworkKeyRef