#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
-
| fs | Pointer to the file system. |
| id | ID of the entry to be written. |
| data | Pointer to the data to be written. |
| len | Number 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
-
| -EFAULT | if fs is NULL. |
| -EACCES | if BM_ZMS is still not initialized. |
| -EIO | if there is an internal error. |
| -EINVAL | if len is invalid. |