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

Health Client Model. More...

Data Structures

struct  bt_mesh_health_cli
 

Macros

#define BT_MESH_MODEL_HEALTH_CLI(cli_data)
 Generic Health Client model composition data entry. More...
 

Functions

int bt_mesh_health_cli_set (struct bt_mesh_model *model)
 Set Health client model instance to use for communication. More...
 
int bt_mesh_health_fault_get (uint16_t addr, uint16_t app_idx, uint16_t cid, uint8_t *test_id, uint8_t *faults, size_t *fault_count)
 Get the registered fault state for the given Company ID. More...
 
int bt_mesh_health_fault_clear (uint16_t addr, uint16_t app_idx, uint16_t cid, uint8_t *test_id, uint8_t *faults, size_t *fault_count)
 Clear the registered faults for the given Company ID. More...
 
int bt_mesh_health_fault_test (uint16_t addr, uint16_t app_idx, uint16_t cid, uint8_t test_id, uint8_t *faults, size_t *fault_count)
 Invoke a self-test procedure for the given Company ID. More...
 
int bt_mesh_health_period_get (uint16_t addr, uint16_t app_idx, uint8_t *divisor)
 Get the target node's Health fast period divisor. More...
 
int bt_mesh_health_period_set (uint16_t addr, uint16_t app_idx, uint8_t divisor, uint8_t *updated_divisor)
 Set the target node's Health fast period divisor. More...
 
int bt_mesh_health_attention_get (uint16_t addr, uint16_t app_idx, uint8_t *attention)
 Get the current attention timer value. More...
 
int bt_mesh_health_attention_set (uint16_t addr, uint16_t app_idx, uint8_t attention, uint8_t *updated_attention)
 Set the attention timer. More...
 
int32_t bt_mesh_health_cli_timeout_get (void)
 Get the current transmission timeout value. More...
 
void bt_mesh_health_cli_timeout_set (int32_t timeout)
 Set the transmission timeout value. More...
 

Detailed Description

Health Client Model.

Macro Definition Documentation

◆ BT_MESH_MODEL_HEALTH_CLI

#define BT_MESH_MODEL_HEALTH_CLI (   cli_data)

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

Value:
NULL, cli_data, &bt_mesh_health_cli_cb)
#define BT_MESH_MODEL_ID_HEALTH_CLI
Definition: access.h:108
#define BT_MESH_MODEL_CB(_id, _op, _pub, _user_data, _cb)
Composition data SIG model entry with callback functions.
Definition: access.h:219

Generic Health Client model composition data entry.

Parameters
cli_dataPointer to a Health Client Model instance.

Function Documentation

◆ bt_mesh_health_attention_get()

int bt_mesh_health_attention_get ( uint16_t  addr,
uint16_t  app_idx,
uint8_t attention 
)

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

Get the current attention timer value.

Parameters
addrTarget node element address.
app_idxApplication index to encrypt with.
attentionAttention timer response buffer, measured in seconds.
Returns
0 on success, or (negative) error code on failure.

◆ bt_mesh_health_attention_set()

int bt_mesh_health_attention_set ( uint16_t  addr,
uint16_t  app_idx,
uint8_t  attention,
uint8_t updated_attention 
)

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

Set the attention timer.

Parameters
addrTarget node element address.
app_idxApplication index to encrypt with.
attentionNew attention timer time, in seconds.
updated_attentionAttention timer response buffer, measured in seconds.
Returns
0 on success, or (negative) error code on failure.

◆ bt_mesh_health_cli_set()

int bt_mesh_health_cli_set ( struct bt_mesh_model model)

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

Set Health client model instance to use for communication.

Parameters
modelHealth Client model instance from the composition data.
Returns
0 on success, or (negative) error code on failure.

◆ bt_mesh_health_cli_timeout_get()

int32_t bt_mesh_health_cli_timeout_get ( void  )

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

Get the current transmission timeout value.

Returns
The configured transmission timeout in milliseconds.

◆ bt_mesh_health_cli_timeout_set()

void bt_mesh_health_cli_timeout_set ( int32_t  timeout)

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

Set the transmission timeout value.

Parameters
timeoutThe new transmission timeout.

◆ bt_mesh_health_fault_clear()

int bt_mesh_health_fault_clear ( uint16_t  addr,
uint16_t  app_idx,
uint16_t  cid,
uint8_t test_id,
uint8_t faults,
size_t *  fault_count 
)

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

Clear the registered faults for the given Company ID.

See also
Health faults
Parameters
addrTarget node element address.
app_idxApplication index to encrypt with.
cidCompany ID to clear the registered faults for.
test_idTest ID response buffer.
faultsFault array response buffer.
fault_countFault count response buffer.
Returns
0 on success, or (negative) error code on failure.

◆ bt_mesh_health_fault_get()

int bt_mesh_health_fault_get ( uint16_t  addr,
uint16_t  app_idx,
uint16_t  cid,
uint8_t test_id,
uint8_t faults,
size_t *  fault_count 
)

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

Get the registered fault state for the given Company ID.

See also
Health faults
Parameters
addrTarget node element address.
app_idxApplication index to encrypt with.
cidCompany ID to get the registered faults of.
test_idTest ID response buffer.
faultsFault array response buffer.
fault_countFault count response buffer.
Returns
0 on success, or (negative) error code on failure.

◆ bt_mesh_health_fault_test()

int bt_mesh_health_fault_test ( uint16_t  addr,
uint16_t  app_idx,
uint16_t  cid,
uint8_t  test_id,
uint8_t faults,
size_t *  fault_count 
)

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

Invoke a self-test procedure for the given Company ID.

Parameters
addrTarget node element address.
app_idxApplication index to encrypt with.
cidCompany ID to invoke the test for.
test_idTest ID response buffer.
faultsFault array response buffer.
fault_countFault count response buffer.
Returns
0 on success, or (negative) error code on failure.

◆ bt_mesh_health_period_get()

int bt_mesh_health_period_get ( uint16_t  addr,
uint16_t  app_idx,
uint8_t divisor 
)

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

Get the target node's Health fast period divisor.

The health period divisor is used to increase the publish rate when a fault is registered. Normally, the Health server will publish with the period in the configured publish parameters. When a fault is registered, the publish period is divided by (1 << divisor). For example, if the target node's Health server is configured to publish with a period of 16 seconds, and the Health fast period divisor is 5, the Health server will publish with an interval of 500 ms when a fault is registered.

Parameters
addrTarget node element address.
app_idxApplication index to encrypt with.
divisorHealth period divisor response buffer.
Returns
0 on success, or (negative) error code on failure.

◆ bt_mesh_health_period_set()

int bt_mesh_health_period_set ( uint16_t  addr,
uint16_t  app_idx,
uint8_t  divisor,
uint8_t updated_divisor 
)

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

Set the target node's Health fast period divisor.

The health period divisor is used to increase the publish rate when a fault is registered. Normally, the Health server will publish with the period in the configured publish parameters. When a fault is registered, the publish period is divided by (1 << divisor). For example, if the target node's Health server is configured to publish with a period of 16 seconds, and the Health fast period divisor is 5, the Health server will publish with an interval of 500 ms when a fault is registered.

Parameters
addrTarget node element address.
app_idxApplication index to encrypt with.
divisorNew Health period divisor.
updated_divisorHealth period divisor response buffer.
Returns
0 on success, or (negative) error code on failure.