Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
settings_handler_static Struct Reference

Config handlers without the node element, used for static handlers. More...

#include <zephyr/settings/settings.h>

Data Fields

const char * name
 Name of subtree.
int cprio
 Priority of commit, lower value is higher priority.
int(* h_get )(const char *key, char *val, int val_len_max)
 Get values handler of settings items identified by keyword names.
int(* h_set )(const char *key, size_t len, settings_read_cb read_cb, void *cb_arg)
 Set value handler of settings items identified by keyword names.
int(* h_commit )(void)
 This handler gets called after settings has been loaded in full.
int(* h_export )(int(*export_func)(const char *name, const void *val, size_t val_len))
 This gets called to dump all current settings items.

Detailed Description

Config handlers without the node element, used for static handlers.

These are registered using a call to SETTINGS_STATIC_HANDLER_DEFINE().

Field Documentation

◆ cprio

int settings_handler_static::cprio

Priority of commit, lower value is higher priority.

◆ h_commit

int(* settings_handler_static::h_commit) (void)

This handler gets called after settings has been loaded in full.

User might use it to apply setting to the application.

Returns
0 on success, non-zero on failure.

◆ h_export

int(* settings_handler_static::h_export) (int(*export_func)(const char *name, const void *val, size_t val_len))

This gets called to dump all current settings items.

This happens when settings_save tries to save the settings.

Parameters
[in]export_funcThe pointer to the internal function which appends a single key-value pair to persisted settings. Don't store duplicated value. The name is subtree/key string, val is the string with value.
Remarks
The User might limit a implementations of handler to serving only one keyword at one call - what will impose limit to get/set values using full subtree/key name.
Returns
0 on success, non-zero on failure.

◆ h_get

int(* settings_handler_static::h_get) (const char *key, char *val, int val_len_max)

Get values handler of settings items identified by keyword names.

Parameters
[in]keyThe name with skipped part that was used as name in handler registration
[out]valBuffer to receive value.
[in]val_len_maxSize of that buffer.
Returns
Length of data read on success, negative on failure.

◆ h_set

int(* settings_handler_static::h_set) (const char *key, size_t len, settings_read_cb read_cb, void *cb_arg)

Set value handler of settings items identified by keyword names.

Parameters
[in]keyThe name with skipped part that was used as name in handler registration
[in]lenThe size of the data found in the backend.
[in]read_cbFunction provided to read the data from the backend.
[in]cb_argArguments for the read function provided by the backend.
Returns
0 on success, non-zero on failure.

◆ name

const char* settings_handler_static::name

Name of subtree.


The documentation for this struct was generated from the following file: