nRF Connect SDK Bare Metal API 2.0.99
Loading...
Searching...
No Matches

◆ bm_zms_write()

ssize_t bm_zms_write ( struct bm_zms_fs * fs,
uint32_t id,
const void * data,
size_t len )

#include <bm_zms.h>

Write an entry to the file system.

Note
When the len parameter is equal to 0 the entry is effectively removed (it is equivalent to calling bm_zms_delete()). It is not possible to distinguish between a deleted entry and an entry with data of length 0. Once the write operation is completed, a BM_ZMS_EVT_WRITE event will be propagated to the configured event handler.
Parameters
fsPointer to the file system.
idID of the entry to be written.
dataPointer to the data to be written.
lenNumber of bytes to be written (maximum 64 KiB).
Returns
Number of bytes queued for write. On success, it will be equal to the number of bytes requested to be written or 0. On error, returns negative value of error codes defined in errno.h.
Return values
-EFAULTif fs is NULL.
-EACCESif BM_ZMS is still not initialized.
-EIOif there is an internal error.
-EINVALif len is invalid.