Zephyr Project API  3.4.0
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)
 
#define BT_MESH_HEALTH_TEST_INFO_METADATA_ID   0x0001
 
#define BT_MESH_HEALTH_TEST_INFO_METADATA(tests)
 
#define BT_MESH_HEALTH_TEST_INFO(cid, tests...)    BT_BYTES_LIST_LE16(cid), sizeof((uint8_t[]){ tests }), tests
 

Functions

int bt_mesh_health_srv_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/zephyr/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_HEALTH_TEST_INFO

#define BT_MESH_HEALTH_TEST_INFO (   cid,
  tests... 
)     BT_BYTES_LIST_LE16(cid), sizeof((uint8_t[]){ tests }), tests

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

Define a Health Test Info Metadata array.

Parameters
cidCompany ID of the Health Test suite.
testsA comma separated list of tests.
Returns
A comma separated list of values that make Health Test Info Metadata

◆ BT_MESH_HEALTH_TEST_INFO_METADATA

#define BT_MESH_HEALTH_TEST_INFO_METADATA (   tests)

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

Value:
{ \
.len = ARRAY_SIZE(tests), \
.data = tests, \
}
#define BT_MESH_HEALTH_TEST_INFO_METADATA_ID
Definition: health_srv.h:191
#define ARRAY_SIZE(array)
Number of elements in the given array.
Definition: util.h:122
static struct test_rec tests[]
Definition: timer_convert.c:36

◆ BT_MESH_HEALTH_TEST_INFO_METADATA_ID

#define BT_MESH_HEALTH_TEST_INFO_METADATA_ID   0x0001

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

Health Test Information Metadata ID.

◆ BT_MESH_MODEL_HEALTH_SRV

#define BT_MESH_MODEL_HEALTH_SRV (   srv,
  pub 
)

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

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

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_health_srv_fault_update()

int bt_mesh_health_srv_fault_update ( struct bt_mesh_elem elem)

#include <include/zephyr/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.