38 #ifndef HEALTH_SERVER_H__ 39 #define HEALTH_SERVER_H__ 47 #include "health_common.h" 48 #include "nrf_mesh_config_app.h" 58 #define HEALTH_SERVER_FAULT_ARRAY_SIZE 256 health_server_selftest_cb_t selftest_function
Pointer to the self-test function.
#define HEALTH_SERVER_FAULT_ARRAY_SIZE
Size of the health server fault array.
uint16_t access_model_handle_t
Access layer handle type.
uint8_t attention_timer
Timer for the attention state.
uint8_t num_selftests
Number of self-tests in p_selftests.
void health_server_fault_register(health_server_t *p_server, uint8_t fault_code)
Registers a fault in the current fault array.
uint32_t health_server_init(health_server_t *p_server, uint16_t element_index, uint16_t company_id, health_server_attention_cb_t attention_cb, const health_server_selftest_t *p_selftests, uint8_t num_selftests)
Initializes the health server model.
uint8_t health_server_fault_count_get(const health_server_t *p_server)
Gets the number of currently set faults in the fault array.
health_server_fault_array_t current_faults
Array of current faults.
Health server instance structure.
const health_server_selftest_t * p_selftests
Pointer to an array of self-tests.
void health_server_fault_clear(health_server_t *p_server, uint8_t fault_code)
Clears a fault from the current fault array.
health_server_fault_array_t registered_faults
Array of registered faults.
struct __health_server_t * p_next
Pointer to the next instance.
uint8_t health_server_attention_get(const health_server_t *p_server)
Gets the current value of the attention timer.
uint8_t test_id
Self-test ID.
uint8_t fast_period_divisor
Fast period divisor, used to increase publishing interval when faults are present.
uint32_t health_server_fault_array_t[BITFIELD_BLOCK_COUNT(HEALTH_SERVER_FAULT_ARRAY_SIZE)]
Health server fault array type.
uint16_t company_id
Health server company ID.
bool health_server_fault_is_set(health_server_t *p_server, uint8_t fault_code)
Checks if a fault code is set in current fault array.
void(* health_server_attention_cb_t)(const health_server_t *p_server, bool attention_state)
Callback function for the attention state.
uint8_t previous_test_id
ID of the latest self-test run by the model.
void(* health_server_selftest_cb_t)(health_server_t *p_server, uint16_t company_id, uint8_t test_id)
Self-test function type.
void health_server_attention_set(health_server_t *p_server, uint8_t attention)
Sets the attention timer value.
access_model_handle_t model_handle
Model handle.
Structure defining a self-test function.
health_server_attention_cb_t attention_handler
Handler for the attention state.