Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
bt_mesh_model_cb Struct Reference

#include <access.h>

Data Fields

int(*const settings_set )(struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg)
 Set value handler of user data tied to the model. More...
 
int(*const start )(struct bt_mesh_model *model)
 Callback called when the mesh is started. More...
 
int(*const init )(struct bt_mesh_model *model)
 Model init callback. More...
 
void(*const reset )(struct bt_mesh_model *model)
 Model reset callback. More...
 

Detailed Description

Model callback functions.

Field Documentation

◆ init

int(*const bt_mesh_model_cb::init) (struct bt_mesh_model *model)

Model init callback.

Called on every model instance during mesh initialization.

If any of the model init callbacks return an error, the Mesh subsystem initialization will be aborted, and the error will be returned to the caller of bt_mesh_init.

Parameters
modelModel to be initialized.
Returns
0 on success, error otherwise.

◆ reset

void(*const bt_mesh_model_cb::reset) (struct bt_mesh_model *model)

Model reset callback.

Called when the mesh node is reset. All model data is deleted on reset, and the model should clear its state.

Note
If the model stores any persistent data, this needs to be erased manually.
Parameters
modelModel this callback belongs to.

◆ settings_set

int(*const bt_mesh_model_cb::settings_set) (struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg)

Set value handler of user data tied to the model.

See also
settings_handler::h_set
Parameters
modelModel to set the persistent data of.
nameName/key of the settings item.
len_rdThe size of the data found in the backend.
read_cbFunction provided to read the data from the backend.
cb_argArguments for the read function provided by the backend.
Returns
0 on success, error otherwise.

◆ start

int(*const bt_mesh_model_cb::start) (struct bt_mesh_model *model)

Callback called when the mesh is started.

This handler gets called after the node has been provisioned, or after all mesh data has been loaded from persistent storage.

When this callback fires, the mesh model may start its behavior, and all Access APIs are ready for use.

Parameters
modelModel this callback belongs to.
Returns
0 on success, error otherwise.

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