Bluetooth: Mesh: Add model reset callback

Adds additional model callback that gets called on node_reset. Will also
erase any user data when this happens.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
This commit is contained in:
Trond Einar Snekvik 2019-09-16 14:48:11 +02:00 committed by Johan Hedberg
commit b7d05fbf13
4 changed files with 34 additions and 7 deletions

View file

@ -422,6 +422,15 @@ struct bt_mesh_model_cb {
* @return 0 on success, error otherwise.
*/
int (*const init)(struct bt_mesh_model *model);
/** @brief Model reset callback.
*
* Called when the mesh node is reset. All model data is deleted on
* reset, and the model should clear its state.
*
* @param model Model this callback belongs to.
*/
void (*const reset)(struct bt_mesh_model *model);
};
/** Abstraction that describes a Mesh Model instance */