Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
bt_mesh_health_srv_cb Struct Reference

#include <health_srv.h>

Data Fields

int(* fault_get_cur )(struct bt_mesh_model *model, uint8_t *test_id, uint16_t *company_id, uint8_t *faults, uint8_t *fault_count)
 Callback for fetching current faults. More...
 
int(* fault_get_reg )(struct bt_mesh_model *model, uint16_t company_id, uint8_t *test_id, uint8_t *faults, uint8_t *fault_count)
 Callback for fetching all registered faults. More...
 
int(* fault_clear )(struct bt_mesh_model *model, uint16_t company_id)
 Clear all registered faults associated with the given Company ID. More...
 
int(* fault_test )(struct bt_mesh_model *model, uint8_t test_id, uint16_t company_id)
 Run a self-test. More...
 
void(* attn_on )(struct bt_mesh_model *model)
 Start calling attention to the device. More...
 
void(* attn_off )(struct bt_mesh_model *model)
 Stop the attention state. More...
 

Detailed Description

Callback function for the Health Server model

Field Documentation

◆ attn_off

void(* bt_mesh_health_srv_cb::attn_off) (struct bt_mesh_model *model)

Stop the attention state.

Any physical activity started to call attention to the device should be stopped.

Parameters
model

◆ attn_on

void(* bt_mesh_health_srv_cb::attn_on) (struct bt_mesh_model *model)

Start calling attention to the device.

The attention state is used to map an element address to a physical device. When this callback is called, the device should start some physical procedure meant to call attention to itself, like blinking, buzzing, vibrating or moving. If there are multiple Health server instances on the device, the attention state should also help identify the specific element the server is in.

The attention calling behavior should continue until the attn_off callback is called.

Parameters
modelHealth Server model to start the attention state of.

◆ fault_clear

int(* bt_mesh_health_srv_cb::fault_clear) (struct bt_mesh_model *model, uint16_t company_id)

Clear all registered faults associated with the given Company ID.

Parameters
modelHealth Server model instance to clear faults of.
company_idCompany ID to clear faults for.
Returns
0 on success, or (negative) error code otherwise.

◆ fault_get_cur

int(* bt_mesh_health_srv_cb::fault_get_cur) (struct bt_mesh_model *model, uint8_t *test_id, uint16_t *company_id, uint8_t *faults, uint8_t *fault_count)

Callback for fetching current faults.

Fault values may either be defined by the specification, or by a vendor. Vendor specific faults should be interpreted in the context of the accompanying Company ID. Specification defined faults may be reported for any Company ID, and the same fault may be presented for multiple Company IDs.

All faults shall be associated with at least one Company ID, representing the device vendor or some other vendor whose vendor specific fault values are used.

If there are multiple Company IDs that have active faults, return only the faults associated with one of them at the time. To report faults for multiple Company IDs, interleave which Company ID is reported for each call.

Parameters
modelHealth Server model instance to get faults of.
test_idTest ID response buffer.
company_idCompany ID response buffer.
faultsArray to fill with current faults.
fault_countThe number of faults the fault array can fit. Should be updated to reflect the number of faults copied into the array.
Returns
0 on success, or (negative) error code otherwise.

◆ fault_get_reg

int(* bt_mesh_health_srv_cb::fault_get_reg) (struct bt_mesh_model *model, uint16_t company_id, uint8_t *test_id, uint8_t *faults, uint8_t *fault_count)

Callback for fetching all registered faults.

Registered faults are all past and current faults since the last call to fault_clear. Only faults associated with the given Company ID should be reported.

Fault values may either be defined by the specification, or by a vendor. Vendor specific faults should be interpreted in the context of the accompanying Company ID. Specification defined faults may be reported for any Company ID, and the same fault may be presented for multiple Company IDs.

Parameters
modelHealth Server model instance to get faults of.
company_idCompany ID to get faults for.
test_idTest ID response buffer.
faultsArray to fill with registered faults.
fault_countThe number of faults the fault array can fit. Should be updated to reflect the number of faults copied into the array.
Returns
0 on success, or (negative) error code otherwise.

◆ fault_test

int(* bt_mesh_health_srv_cb::fault_test) (struct bt_mesh_model *model, uint8_t test_id, uint16_t company_id)

Run a self-test.

The Health server may support up to 256 self-tests for each Company ID. The behavior for all test IDs are vendor specific, and should be interpreted based on the accompanying Company ID. Test failures should result in changes to the fault array.

Parameters
modelHealth Server model instance to run test for.
test_idTest ID to run.
company_idCompany ID to run test for.
Returns
0 if the test execution was started successfully, or (negative) error code otherwise. Note that the fault array will not be reported back to the client if the test execution didn't start.

The documentation for this struct was generated from the following file: