Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
bt_mesh_model_cb Struct Reference

Model callback functions. More...

#include <access.h>

Data Fields

int(*const settings_set )(const 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.
 
int(*const start )(const struct bt_mesh_model *model)
 Callback called when the mesh is started.
 
int(*const init )(const struct bt_mesh_model *model)
 Model init callback.
 
void(*const reset )(const struct bt_mesh_model *model)
 Model reset callback.
 
void(*const pending_store )(const struct bt_mesh_model *model)
 Callback used to store pending model's user data.
 

Detailed Description

Model callback functions.

Field Documentation

◆ init

int(*const bt_mesh_model_cb::init) (const 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.

◆ pending_store

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

Callback used to store pending model's user data.

Triggered by bt_mesh_model_data_store_schedule.

To store the user data, call bt_mesh_model_data_store.

Parameters
modelModel this callback belongs to.

◆ reset

void(*const bt_mesh_model_cb::reset) (const 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) (const 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) (const 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: