Zephyr API Documentation
3.0.0
A Scalable Open Source RTOS
|
|
3.0.0 |
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_clear_unack (uint16_t addr, uint16_t app_idx, uint16_t cid) |
Clear the registered faults for the given Company ID (unacked). 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_fault_test_unack (uint16_t addr, uint16_t app_idx, uint16_t cid, uint8_t test_id) |
Invoke a self-test procedure for the given Company ID (unacked). 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_period_set_unack (uint16_t addr, uint16_t app_idx, uint8_t divisor) |
Set the target node's Health fast period divisor (unacknowledged). 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... | |
int | bt_mesh_health_attention_set_unack (uint16_t addr, uint16_t app_idx, uint8_t attention) |
Set the attention timer (unacknowledged). 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... | |
Health Client Model.
#define BT_MESH_MODEL_HEALTH_CLI | ( | cli_data | ) |
#include <include/bluetooth/mesh/health_cli.h>
Generic Health Client model composition data entry.
cli_data | Pointer to a Health Client Model instance. |
#include <include/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.
addr | Target node element address. |
app_idx | Application index to encrypt with. |
attention | Attention timer response buffer, measured in seconds. |
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.
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.
addr | Target node element address. |
app_idx | Application index to encrypt with. |
attention | New attention timer time, in seconds. |
updated_attention | Attention timer response buffer, measured in seconds. |
#include <include/bluetooth/mesh/health_cli.h>
Set the attention timer (unacknowledged).
addr | Target node element address. |
app_idx | Application index to encrypt with. |
attention | New attention timer time, in seconds. |
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.
model | Health Client model instance from the composition data. |
int32_t bt_mesh_health_cli_timeout_get | ( | void | ) |
#include <include/bluetooth/mesh/health_cli.h>
Get the current transmission timeout value.
void bt_mesh_health_cli_timeout_set | ( | int32_t | timeout | ) |
#include <include/bluetooth/mesh/health_cli.h>
Set the transmission timeout value.
timeout | The new transmission timeout. |
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.
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.
addr | Target node element address. |
app_idx | Application index to encrypt with. |
cid | Company ID to clear the registered faults for. |
test_id | Test ID response buffer. |
faults | Fault array response buffer. |
fault_count | Fault count response buffer. |
#include <include/bluetooth/mesh/health_cli.h>
Clear the registered faults for the given Company ID (unacked).
addr | Target node element address. |
app_idx | Application index to encrypt with. |
cid | Company ID to clear the registered faults for. |
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.
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.
addr | Target node element address. |
app_idx | Application index to encrypt with. |
cid | Company ID to get the registered faults of. |
test_id | Test ID response buffer. |
faults | Fault array response buffer. |
fault_count | Fault count response buffer. |
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.
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.
addr | Target node element address. |
app_idx | Application index to encrypt with. |
cid | Company ID to invoke the test for. |
test_id | Test ID response buffer. |
faults | Fault array response buffer. |
fault_count | Fault count response buffer. |
int bt_mesh_health_fault_test_unack | ( | uint16_t | addr, |
uint16_t | app_idx, | ||
uint16_t | cid, | ||
uint8_t | test_id | ||
) |
#include <include/bluetooth/mesh/health_cli.h>
Invoke a self-test procedure for the given Company ID (unacked).
addr | Target node element address. |
app_idx | Application index to encrypt with. |
cid | Company ID to invoke the test for. |
test_id | Test ID response buffer. |
#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.
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.
addr | Target node element address. |
app_idx | Application index to encrypt with. |
divisor | Health period divisor response buffer. |
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.
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.
addr | Target node element address. |
app_idx | Application index to encrypt with. |
divisor | New Health period divisor. |
updated_divisor | Health period divisor response buffer. |
#include <include/bluetooth/mesh/health_cli.h>
Set the target node's Health fast period divisor (unacknowledged).
This is an unacknowledged version of this API.
addr | Target node element address. |
app_idx | Application index to encrypt with. |
divisor | New Health period divisor. |