The Config module is designed as an interface to the device's non-volatile configurations and is wrapper around Zephyr's NVS interface. It allows access to CRUD operations where permissions can set during item creation.
More...
#include <zephyr/kernel.h>
Go to the source code of this file.
|
enum | module_configFlags_t { CONFIG_FLAG_READ_ONLY = 1
} |
|
enum | module_configItemID_t { CONFIG_ITEM_WIFI_SSID
, CONFIG_ITEM_WIFI_PSK
, CONFIG_ITEM_MAX
} |
|
|
int8_t | module_configInit (void) |
| initialise the configuration module
|
|
int8_t | module_configCreate (module_configItemID_t item_id, uint8_t length, void *buff, module_configFlags_t flags) |
| creates a config item
|
|
int8_t | module_configRead (module_configItemID_t item_id, uint8_t length, void *buff) |
| reads an item from the config into the buffer provided
|
|
int8_t | module_configUpdate (module_configItemID_t item_id, uint8_t length, void *buff) |
| updates a config item
|
|
int8_t | module_configDelete (module_configItemID_t item_id) |
| deletes a config item
|
|
The Config module is designed as an interface to the device's non-volatile configurations and is wrapper around Zephyr's NVS interface. It allows access to CRUD operations where permissions can set during item creation.
◆ module_configCreate()
int8_t module_configCreate |
( |
module_configItemID_t | item_id, |
|
|
uint8_t | length, |
|
|
void * | buff, |
|
|
module_configFlags_t | flags ) |
creates a config item
- Parameters
-
type | module_configItemID_t which config item to write |
length | length of item which will be writeen |
buff | void buffer with item data to write |
flags | bit field of flags to set for item |
- Returns
- 0 on success or -errno on failure
◆ module_configDelete()
int8_t module_configDelete |
( |
module_configItemID_t | item_id | ) |
|
deletes a config item
- Parameters
-
item | config item to delete |
- Returns
- 0 on success or -errno on failure
◆ module_configInit()
int8_t module_configInit |
( |
void | | ) |
|
initialise the configuration module
- Returns
- 0 on success or -errno on failure
◆ module_configRead()
int8_t module_configRead |
( |
module_configItemID_t | item_id, |
|
|
uint8_t | length, |
|
|
void * | buff ) |
reads an item from the config into the buffer provided
- Parameters
-
type | module_configItemID_t which config item to read |
length | length of item to read |
buff | void buffer to read the item data into |
- Returns
- 0 on success or -errno on failure
◆ module_configUpdate()
int8_t module_configUpdate |
( |
module_configItemID_t | item_id, |
|
|
uint8_t | length, |
|
|
void * | buff ) |
updates a config item
- Parameters
-
type | module_configItemID_t which config item to write |
length | length of item which will be writen |
buff | void buffer with item data to write |
- Returns
- 0 on success or -errno on failure