Zephyr Project API 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Health Client Model

Health Client Model. More...

Data Structures

struct  bt_mesh_health_cli
 Health Client Model Context. More...
 

Macros

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

Functions

int bt_mesh_health_cli_fault_get (struct bt_mesh_health_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t cid, uint8_t *test_id, uint8_t *faults, size_t *fault_count)
 Get the registered fault state for the given Company ID.
 
int bt_mesh_health_cli_fault_clear (struct bt_mesh_health_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t cid, uint8_t *test_id, uint8_t *faults, size_t *fault_count)
 Clear the registered faults for the given Company ID.
 
int bt_mesh_health_cli_fault_clear_unack (struct bt_mesh_health_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t cid)
 Clear the registered faults for the given Company ID (unacked).
 
int bt_mesh_health_cli_fault_test (struct bt_mesh_health_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t cid, uint8_t test_id, uint8_t *faults, size_t *fault_count)
 Invoke a self-test procedure for the given Company ID.
 
int bt_mesh_health_cli_fault_test_unack (struct bt_mesh_health_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t cid, uint8_t test_id)
 Invoke a self-test procedure for the given Company ID (unacked).
 
int bt_mesh_health_cli_period_get (struct bt_mesh_health_cli *cli, struct bt_mesh_msg_ctx *ctx, uint8_t *divisor)
 Get the target node's Health fast period divisor.
 
int bt_mesh_health_cli_period_set (struct bt_mesh_health_cli *cli, struct bt_mesh_msg_ctx *ctx, uint8_t divisor, uint8_t *updated_divisor)
 Set the target node's Health fast period divisor.
 
int bt_mesh_health_cli_period_set_unack (struct bt_mesh_health_cli *cli, struct bt_mesh_msg_ctx *ctx, uint8_t divisor)
 Set the target node's Health fast period divisor (unacknowledged).
 
int bt_mesh_health_cli_attention_get (struct bt_mesh_health_cli *cli, struct bt_mesh_msg_ctx *ctx, uint8_t *attention)
 Get the current attention timer value.
 
int bt_mesh_health_cli_attention_set (struct bt_mesh_health_cli *cli, struct bt_mesh_msg_ctx *ctx, uint8_t attention, uint8_t *updated_attention)
 Set the attention timer.
 
int bt_mesh_health_cli_attention_set_unack (struct bt_mesh_health_cli *cli, struct bt_mesh_msg_ctx *ctx, uint8_t attention)
 Set the attention timer (unacknowledged).
 
int32_t bt_mesh_health_cli_timeout_get (void)
 Get the current transmission timeout value.
 
void bt_mesh_health_cli_timeout_set (int32_t timeout)
 Set the transmission timeout value.
 

Detailed Description

Health Client Model.

Macro Definition Documentation

◆ BT_MESH_MODEL_HEALTH_CLI

#define BT_MESH_MODEL_HEALTH_CLI (   cli_data)

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

Value:
&(cli_data)->pub, cli_data, &bt_mesh_health_cli_cb)
#define BT_MESH_MODEL_ID_HEALTH_CLI
Health Client.
Definition access.h:185
#define BT_MESH_MODEL_CB(_id, _op, _pub, _user_data, _cb)
Composition data SIG model entry with callback functions.
Definition access.h:495

Generic Health Client model composition data entry.

Parameters
cli_dataPointer to a Health Client Model instance.

Function Documentation

◆ bt_mesh_health_cli_attention_get()

int bt_mesh_health_cli_attention_get ( struct bt_mesh_health_cli cli,
struct bt_mesh_msg_ctx ctx,
uint8_t attention 
)

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

Get the current attention timer value.

This method can be used asynchronously by setting attention as NULL. This way the method will not wait for response and will return immediately after sending the command.

To process the response arguments of an async method, register the attention_status callback in bt_mesh_health_cli struct.

Parameters
cliClient model to send on.
ctxMessage context, or NULL to use the configured publish parameters.
attentionAttention timer response buffer, measured in seconds.
Returns
0 on success, or (negative) error code on failure.

◆ bt_mesh_health_cli_attention_set()

int bt_mesh_health_cli_attention_set ( struct bt_mesh_health_cli cli,
struct bt_mesh_msg_ctx ctx,
uint8_t  attention,
uint8_t updated_attention 
)

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

Set the attention timer.

This method can be used asynchronously by setting updated_attention as NULL. This way the method will not wait for response and will return immediately after sending the command.

To process the response arguments of an async method, register the attention_status callback in bt_mesh_health_cli struct.

Parameters
cliClient model to send on.
ctxMessage context, or NULL to use the configured publish parameters.
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_attention_set_unack()

int bt_mesh_health_cli_attention_set_unack ( struct bt_mesh_health_cli cli,
struct bt_mesh_msg_ctx ctx,
uint8_t  attention 
)

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

Set the attention timer (unacknowledged).

Parameters
cliClient model to send on.
ctxMessage context, or NULL to use the configured publish parameters.
attentionNew attention timer time, in seconds.
Returns
0 on success, or (negative) error code on failure.

◆ bt_mesh_health_cli_fault_clear()

int bt_mesh_health_cli_fault_clear ( struct bt_mesh_health_cli cli,
struct bt_mesh_msg_ctx ctx,
uint16_t  cid,
uint8_t test_id,
uint8_t faults,
size_t fault_count 
)

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

Clear the registered faults for the given Company ID.

This method can be used asynchronously by setting test_id and ( faults or fault_count ) as NULL This way the method will not wait for response and will return immediately after sending the command.

To process the response arguments of an async method, register the fault_status callback in bt_mesh_health_cli struct.

See also
Health faults
Parameters
cliClient model to send on.
ctxMessage context, or NULL to use the configured publish parameters.
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_cli_fault_clear_unack()

int bt_mesh_health_cli_fault_clear_unack ( struct bt_mesh_health_cli cli,
struct bt_mesh_msg_ctx ctx,
uint16_t  cid 
)

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

Clear the registered faults for the given Company ID (unacked).

See also
Health faults
Parameters
cliClient model to send on.
ctxMessage context, or NULL to use the configured publish parameters.
cidCompany ID to clear the registered faults for.
Returns
0 on success, or (negative) error code on failure.

◆ bt_mesh_health_cli_fault_get()

int bt_mesh_health_cli_fault_get ( struct bt_mesh_health_cli cli,
struct bt_mesh_msg_ctx ctx,
uint16_t  cid,
uint8_t test_id,
uint8_t faults,
size_t fault_count 
)

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

Get the registered fault state for the given Company ID.

This method can be used asynchronously by setting test_id and ( faults or fault_count ) as NULL This way the method will not wait for response and will return immediately after sending the command.

To process the response arguments of an async method, register the fault_status callback in bt_mesh_health_cli struct.

See also
Health faults
Parameters
cliClient model to send on.
ctxMessage context, or NULL to use the configured publish parameters.
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_cli_fault_test()

int bt_mesh_health_cli_fault_test ( struct bt_mesh_health_cli cli,
struct bt_mesh_msg_ctx ctx,
uint16_t  cid,
uint8_t  test_id,
uint8_t faults,
size_t fault_count 
)

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

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

This method can be used asynchronously by setting faults or fault_count as NULL This way the method will not wait for response and will return immediately after sending the command.

To process the response arguments of an async method, register the fault_status callback in bt_mesh_health_cli struct.

Parameters
cliClient model to send on.
ctxMessage context, or NULL to use the configured publish parameters.
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_cli_fault_test_unack()

int bt_mesh_health_cli_fault_test_unack ( struct bt_mesh_health_cli cli,
struct bt_mesh_msg_ctx ctx,
uint16_t  cid,
uint8_t  test_id 
)

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

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

Parameters
cliClient model to send on.
ctxMessage context, or NULL to use the configured publish parameters.
cidCompany ID to invoke the test for.
test_idTest ID response buffer.
Returns
0 on success, or (negative) error code on failure.

◆ bt_mesh_health_cli_period_get()

int bt_mesh_health_cli_period_get ( struct bt_mesh_health_cli cli,
struct bt_mesh_msg_ctx ctx,
uint8_t divisor 
)

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

This method can be used asynchronously by setting divisor as NULL. This way the method will not wait for response and will return immediately after sending the command.

To process the response arguments of an async method, register the period_status callback in bt_mesh_health_cli struct.

Parameters
cliClient model to send on.
ctxMessage context, or NULL to use the configured publish parameters.
divisorHealth period divisor response buffer.
Returns
0 on success, or (negative) error code on failure.

◆ bt_mesh_health_cli_period_set()

int bt_mesh_health_cli_period_set ( struct bt_mesh_health_cli cli,
struct bt_mesh_msg_ctx ctx,
uint8_t  divisor,
uint8_t updated_divisor 
)

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

This method can be used asynchronously by setting updated_divisor as NULL. This way the method will not wait for response and will return immediately after sending the command.

To process the response arguments of an async method, register the period_status callback in bt_mesh_health_cli struct.

Parameters
cliClient model to send on.
ctxMessage context, or NULL to use the configured publish parameters.
divisorNew Health period divisor.
updated_divisorHealth period divisor response buffer.
Returns
0 on success, or (negative) error code on failure.

◆ bt_mesh_health_cli_period_set_unack()

int bt_mesh_health_cli_period_set_unack ( struct bt_mesh_health_cli cli,
struct bt_mesh_msg_ctx ctx,
uint8_t  divisor 
)

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

Set the target node's Health fast period divisor (unacknowledged).

This is an unacknowledged version of this API.

Parameters
cliClient model to send on.
ctxMessage context, or NULL to use the configured publish parameters.
divisorNew Health period divisor.
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/zephyr/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/zephyr/bluetooth/mesh/health_cli.h>

Set the transmission timeout value.

Parameters
timeoutThe new transmission timeout.