NimBLE-Arduino 2.1.2
Loading...
Searching...
No Matches
bt_mesh_model_cb Struct Reference

#include <access.h>

Public Attributes

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

Detailed Description

Model callback functions.

Member Data 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, char *val)

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.
valData from 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.

See also
settings_handler::h_commit
Parameters
modelModel this callback belongs to.
Returns
0 on success, error otherwise.