|
Zephyr API Documentation 4.3.0-rc1
A Scalable Open Source RTOS
|
Typedefs | |
| typedef uint32_t | zms_id_t |
| ID type used in the ZMS API. | |
Functions | |
| int | zms_mount (struct zms_fs *fs) |
| Mount a ZMS file system onto the device specified in fs. | |
| int | zms_clear (struct zms_fs *fs) |
| Clear the ZMS file system from device. | |
| ssize_t | zms_write (struct zms_fs *fs, zms_id_t id, const void *data, size_t len) |
| Write an entry to the file system. | |
| int | zms_delete (struct zms_fs *fs, zms_id_t id) |
| Delete an entry from the file system. | |
| ssize_t | zms_read (struct zms_fs *fs, zms_id_t id, void *data, size_t len) |
| Read an entry from the file system. | |
| ssize_t | zms_read_hist (struct zms_fs *fs, zms_id_t id, void *data, size_t len, uint32_t cnt) |
| Read a history entry from the file system. | |
| ssize_t | zms_get_data_length (struct zms_fs *fs, zms_id_t id) |
| Gets the length of the data that is stored in an entry with a given id | |
| ssize_t | zms_calc_free_space (struct zms_fs *fs) |
| Calculate the available free space in the file system. | |
| ssize_t | zms_active_sector_free_space (struct zms_fs *fs) |
| Tell how much contiguous free space remains in the currently active ZMS sector. | |
| int | zms_sector_use_next (struct zms_fs *fs) |
| Close the currently active sector and switch to the next one. | |
#include <zephyr/fs/zms.h>
ID type used in the ZMS API.
CONFIG_ZMS_ID_64BIT. #include <zephyr/fs/zms.h>
Tell how much contiguous free space remains in the currently active ZMS sector.
| fs | Pointer to the file system. |
| >=0 | Number of free bytes in the currently active sector |
| -EACCES | if ZMS is still not initialized. |
| -EINVAL | if fs is NULL. |
#include <zephyr/fs/zms.h>
Calculate the available free space in the file system.
| fs | Pointer to the file system. |
| Number | of free bytes (>= 0) on success. |
| -EACCES | if ZMS is still not initialized. |
| -EIO | if there is a memory read/write error. |
| -EINVAL | if fs is NULL. |
| int zms_clear | ( | struct zms_fs * | fs | ) |
#include <zephyr/fs/zms.h>
Clear the ZMS file system from device.
The ZMS file system must be re-mounted after this operation.
| fs | Pointer to the file system. |
| 0 | on success. |
| -EACCES | if fs is not mounted. |
| -ENXIO | if there is a device error. |
| -EIO | if there is a memory read/write error. |
| -EINVAL | if fs is NULL. |
#include <zephyr/fs/zms.h>
Delete an entry from the file system.
| fs | Pointer to the file system. |
| id | ID of the entry to be deleted. |
| 0 | on success. |
| -EACCES | if ZMS is still not initialized. |
| -ENXIO | if there is a device error. |
| -EIO | if there is a memory read/write error. |
| -EINVAL | if fs is NULL. |
#include <zephyr/fs/zms.h>
Gets the length of the data that is stored in an entry with a given id
| fs | Pointer to the file system. |
| id | ID of the entry whose data length to retrieve. |
| Length | of the entry with the given id (> 0) on success. |
| -EACCES | if ZMS is still not initialized. |
| -EIO | if there is a memory read/write error. |
| -ENOENT | if there is no entry with the given id. |
| -EINVAL | if fs is NULL. |
| int zms_mount | ( | struct zms_fs * | fs | ) |
#include <zephyr/fs/zms.h>
Mount a ZMS file system onto the device specified in fs.
| fs | Pointer to the file system. |
| 0 | on success. |
| -ENOTSUP | if the detected file system is not ZMS. |
| -EPROTONOSUPPORT | if the ZMS version is not supported. |
| -EINVAL | if fs is NULL or any of the flash parameters or the sector layout is invalid. |
| -ENXIO | if there is a device error. |
| -EIO | if there is a memory read/write error. |
#include <zephyr/fs/zms.h>
Read an entry from the file system.
| fs | Pointer to the file system. |
| id | ID of the entry to be read. |
| data | Pointer to data buffer. |
| len | Number of bytes to read at most. |
| Number | of bytes read (> 0) on success. |
| -EACCES | if ZMS is still not initialized. |
| -EIO | if there is a memory read/write error. |
| -ENOENT | if there is no entry with the given id. |
| -EINVAL | if fs is NULL. |
#include <zephyr/fs/zms.h>
Read a history entry from the file system.
| fs | Pointer to the file system. |
| id | ID of the entry to be read. |
| data | Pointer to data buffer. |
| len | Number of bytes to be read. |
| cnt | History counter: 0: latest entry, 1: one before latest ... |
| Number | of bytes read (> 0) on success. |
| -EACCES | if ZMS is still not initialized. |
| -EIO | if there is a memory read/write error. |
| -ENOENT | if there is no entry with the given id and history counter. |
| -EINVAL | if fs is NULL. |
| int zms_sector_use_next | ( | struct zms_fs * | fs | ) |
#include <zephyr/fs/zms.h>
Close the currently active sector and switch to the next one.
| fs | Pointer to the file system. |
| 0 | on success. |
| -EACCES | if ZMS is still not initialized. |
| -EIO | if there is a memory read/write error. |
| -EINVAL | if fs is NULL. |
#include <zephyr/fs/zms.h>
Write an entry to the file system.
| 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). |
| Number | of bytes written (len or 0) on success. |
| -EACCES | if ZMS is still not initialized. |
| -ENXIO | if there is a device error. |
| -EIO | if there is a memory read/write error. |
| -EINVAL | if fs is NULL or len is invalid. |
| -ENOSPC | if no space is left on the device. |