Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
Health Server Model

Health Server Model. More...

Data Structures

struct  bt_mesh_health_srv_cb
 
struct  bt_mesh_health_srv
 

Macros

#define BT_MESH_HEALTH_PUB_DEFINE(_name, _max_faults)    BT_MESH_MODEL_PUB_DEFINE(_name, NULL, (1 + 3 + (_max_faults)))
 
#define BT_MESH_MODEL_HEALTH_SRV(srv, pub)
 

Functions

int bt_mesh_fault_update (struct bt_mesh_elem *elem)
 Notify the stack that the fault array state of the given element has changed. More...
 

Detailed Description

Health Server Model.

Macro Definition Documentation

◆ BT_MESH_HEALTH_PUB_DEFINE

#define BT_MESH_HEALTH_PUB_DEFINE (   _name,
  _max_faults 
)     BT_MESH_MODEL_PUB_DEFINE(_name, NULL, (1 + 3 + (_max_faults)))

#include <include/bluetooth/mesh/health_srv.h>

A helper to define a health publication context

Parameters
_nameName given to the publication context variable.
_max_faultsMaximum number of faults the element can have.

◆ BT_MESH_MODEL_HEALTH_SRV

#define BT_MESH_MODEL_HEALTH_SRV (   srv,
  pub 
)

#include <include/bluetooth/mesh/health_srv.h>

Value:
#define BT_MESH_MODEL_ID_HEALTH_SRV
Definition: access.h:107
#define BT_MESH_MODEL_CB(_id, _op, _pub, _user_data, _cb)
Composition data SIG model entry with callback functions.
Definition: access.h:219
Definition: health_srv.h:25

Define a new health server model. Note that this API needs to be repeated for each element that the application wants to have a health server model on. Each instance also needs a unique bt_mesh_health_srv and bt_mesh_model_pub context.

Parameters
srvPointer to a unique struct bt_mesh_health_srv.
pubPointer to a unique struct bt_mesh_model_pub.
Returns
New mesh model instance.

Function Documentation

◆ bt_mesh_fault_update()

int bt_mesh_fault_update ( struct bt_mesh_elem elem)

#include <include/bluetooth/mesh/health_srv.h>

Notify the stack that the fault array state of the given element has changed.

This prompts the Health server on this element to publish the current fault array if periodic publishing is disabled.

Parameters
elemElement to update the fault state of.
Returns
0 on success, or (negative) error code otherwise.