Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
|
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, uint32_t id, const void *data, size_t len) |
Write an entry to the file system. | |
int | zms_delete (struct zms_fs *fs, uint32_t id) |
Delete an entry from the file system. | |
ssize_t | zms_read (struct zms_fs *fs, uint32_t id, void *data, size_t len) |
Read an entry from the file system. | |
ssize_t | zms_read_hist (struct zms_fs *fs, uint32_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, uint32_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. | |
size_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>
Tell how much contiguous free space remains in the currently active ZMS sector.
fs | Pointer to the file system. |
#include <zephyr/fs/zms.h>
Calculate the available free space in the file system.
fs | Pointer to the file system. |
errno.h
. int zms_clear | ( | struct zms_fs * | fs | ) |
#include <zephyr/fs/zms.h>
Clear the ZMS file system from device.
fs | Pointer to the file system. |
0 | Success |
-ERRNO | Negative errno code on error |
#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 | Success |
-ERRNO | Negative errno code on error |
#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. |
errno.h
. 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 | Success |
-ERRNO | Negative errno code on 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 |
errno.h
. #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 ... |
errno.h
. 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. |
errno.h
. #include <zephyr/fs/zms.h>
Write an entry to the file system.
len
parameter is equal to 0
the entry is effectively removed (it is equivalent to calling zms_delete()). It is not possible to distinguish between a deleted entry and an entry with data of length 0.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) |
errno.h
.