IOT Matrix Display
Loading...
Searching...
No Matches
module_config.h File Reference

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>
+ Include dependency graph for module_config.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  wifiConfig_t
 

Enumerations

enum  module_configFlags_t { CONFIG_FLAG_READ_ONLY = 1 }
 
enum  module_configItemID_t { CONFIG_ITEM_WIFI_SSID , CONFIG_ITEM_WIFI_PSK , CONFIG_ITEM_MAX }
 

Functions

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
 

Detailed Description

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.

Function Documentation

◆ 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
typemodule_configItemID_t which config item to write
lengthlength of item which will be writeen
buffvoid buffer with item data to write
flagsbit 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
itemconfig 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
typemodule_configItemID_t which config item to read
lengthlength of item to read
buffvoid 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
typemodule_configItemID_t which config item to write
lengthlength of item which will be writen
buffvoid buffer with item data to write
Returns
0 on success or -errno on failure