nRF Connect SDK API 2.8.99
|
psa_status_t psa_ps_set_extended | ( | psa_storage_uid_t | uid, |
size_t | data_offset, | ||
size_t | data_length, | ||
const void * | p_data ) |
#include <include/protected_storage.h>
Sets partial data into an asset.
Before calling this function, the storage must have been reserved with a call to psa_ps_create. It can also be used to overwrite data in an asset that was created with a call to psa_ps_set. Calling this function with data_length = 0 is permitted, which will make no change to the stored data.This function can overwrite existing data and/or extend it up to the capacity for the uid specified in psa_ps_create, but cannot create gaps.
That is, it has preconditions:
[in] | uid | The uid value |
[in] | data_offset | Offset within the asset to start the write |
[in] | data_length | The size in bytes of the data in p_data to write |
[in] | p_data | Pointer to a buffer which contains the data to write |
PSA_SUCCESS | The asset exists, the input parameters are correct and the data is correctly written in the physical storage. |
PSA_ERROR_STORAGE_FAILURE | The data was not written correctly in the physical storage |
PSA_ERROR_INVALID_ARGUMENT | The operation failed because one or more of the preconditions listed above regarding data_offset, size, or data_length was violated. |
PSA_ERROR_DOES_NOT_EXIST | The specified uid was not found |
PSA_ERROR_NOT_SUPPORTED | The implementation of the API does not support this function |
PSA_ERROR_GENERIC_ERROR | The operation failed due to an unspecified error |
PSA_ERROR_DATA_CORRUPT | The operation failed because the existing data has been corrupted. |
PSA_ERROR_INVALID_SIGNATURE | The operation failed because the existing data failed authentication (MAC check failed). |
PSA_ERROR_NOT_PERMITTED | The operation failed because it was attempted on an asset which was written with the flag PSA_STORAGE_FLAG_WRITE_ONCE |