nvs::NVSHandle::set_blob() method
set variable length binary value for given key This family of functions set value for the key, given its name. Note that actual storage will not be updated until nvs_commit function is called.
Arguments
key
Key name. Maximal length is (NVS_KEY_NAME_MAX_SIZE-1) characters. Shouldn't be empty.
blob
The blob value to set.
len
length of binary value to set, in bytes; Maximum length is 508000 bytes or (97.6% of the partition size - 4000) bytes whichever is lower.
Return value
- ESP_OK if value was set successfully - ESP_ERR_NVS_READ_ONLY if storage handle was opened as read only - ESP_ERR_NVS_INVALID_NAME if key name doesn't satisfy constraints - ESP_ERR_NVS_NOT_ENOUGH_SPACE if there is not enough space in the underlying storage to save the value - ESP_ERR_NVS_REMOVE_FAILED if the value wasn't updated because flash write operation has failed. The value was written however, and update will be finished after re-initialization of nvs, provided that flash operation doesn't fail again. - ESP_ERR_NVS_VALUE_TOO_LONG if the value is too long
Notes
compare to nvs_set_blob in nvs.h
nvs::NVSHandle::set_blob() overrides 2 methodss:
![]()
nvs::NVSHandle::set_blob()