Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Health Server Model

Health Server Model. More...

Data Structures

struct  bt_mesh_health_srv_cb
 Callback function for the Health Server model. More...
 
struct  bt_mesh_health_srv
 Mesh Health Server Model Context. More...
 

Macros

#define BT_MESH_HEALTH_PUB_DEFINE(_name, _max_faults)    BT_MESH_MODEL_PUB_DEFINE(_name, NULL, (1 + 3 + (_max_faults)))
 A helper to define a health publication context.
 
#define BT_MESH_MODEL_HEALTH_SRV(srv, pub, ...)
 Define a new health server model.
 
#define BT_MESH_HEALTH_TEST_INFO_METADATA_ID   0x0000
 Health Test Information Metadata ID.
 
#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
 Define a Health Test Info Metadata array.
 

Functions

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

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 <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 <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 <zephyr/bluetooth/mesh/health_srv.h>

Value:
{ \
.len = ARRAY_SIZE(tests), \
.data = tests, \
}
#define BT_MESH_HEALTH_TEST_INFO_METADATA_ID
Health Test Information Metadata ID.
Definition: health_srv.h:186
#define ARRAY_SIZE(array)
Number of elements in the given array.
Definition: util.h:127

◆ BT_MESH_HEALTH_TEST_INFO_METADATA_ID

#define BT_MESH_HEALTH_TEST_INFO_METADATA_ID   0x0000

#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 <zephyr/bluetooth/mesh/health_srv.h>

Value:
bt_mesh_health_srv_op, \
pub, \
srv, \
&bt_mesh_health_srv_cb, __VA_ARGS__)
#define BT_MESH_MODEL_METADATA_CB(_id, _op, _pub, _user_data, _cb, _metadata)
Composition data SIG model entry with callback functions and metadata.
Definition: access.h:528
#define BT_MESH_MODEL_ID_HEALTH_SRV
Health Server.
Definition: access.h:183
Callback function for the Health Server model.
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.
...Optional Health Server metadata if application is compiled with Large Composition Data Server support, otherwise this parameter is ignored.
Returns
New mesh model instance.

Function Documentation

◆ bt_mesh_health_srv_fault_update()

int bt_mesh_health_srv_fault_update ( const struct bt_mesh_elem elem)

#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.