1 /** @file
2  *  @brief Bluetooth Mesh Health Client Model APIs.
3  */
4 
5 /*
6  * SPDX-FileCopyrightText: 2017 Intel Corporation
7  * SPDX-FileContributor: 2018-2021 Espressif Systems (Shanghai) CO LTD
8  *
9  * SPDX-License-Identifier: Apache-2.0
10  */
11 #ifndef _BLE_MESH_HEALTH_CLI_H_
12 #define _BLE_MESH_HEALTH_CLI_H_
13 
14 #include "client_common.h"
15 
16 /**
17  * @brief Bluetooth Mesh
18  * @defgroup bt_mesh_health_cli Bluetooth Mesh Health Client Model
19  * @ingroup bt_mesh
20  * @{
21  */
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* Health client model common structure */
28 typedef bt_mesh_client_user_data_t      bt_mesh_health_client_t;
29 typedef bt_mesh_client_internal_data_t  health_internal_data_t;
30 
31 extern const struct bt_mesh_model_op bt_mesh_health_cli_op[];
32 extern const struct bt_mesh_model_cb bt_mesh_health_cli_cb;
33 
34 #define BLE_MESH_MODEL_HEALTH_CLI(cli_data)             \
35         BLE_MESH_MODEL_CB(BLE_MESH_MODEL_ID_HEALTH_CLI,    \
36             bt_mesh_health_cli_op, NULL, cli_data, &bt_mesh_health_cli_cb)
37 
38 int bt_mesh_health_fault_get(bt_mesh_client_common_param_t *param, uint16_t cid);
39 
40 int bt_mesh_health_fault_clear(bt_mesh_client_common_param_t *param,
41                                uint16_t cid, bool need_ack);
42 
43 int bt_mesh_health_fault_test(bt_mesh_client_common_param_t *param,
44                               uint16_t cid, uint8_t test_id, bool need_ack);
45 
46 int bt_mesh_health_period_get(bt_mesh_client_common_param_t *param);
47 
48 int bt_mesh_health_period_set(bt_mesh_client_common_param_t *param,
49                               uint8_t divisor, bool need_ack);
50 
51 int bt_mesh_health_attention_get(bt_mesh_client_common_param_t *param);
52 
53 int bt_mesh_health_attention_set(bt_mesh_client_common_param_t *param,
54                                  uint8_t attention, bool need_ack);
55 
56 /* Health Client Status Message Context */
57 
58 struct bt_mesh_health_current_status {
59     uint8_t  test_id;
60     uint16_t cid;
61     struct net_buf_simple *fault_array;
62 };
63 
64 struct bt_mesh_health_fault_status {
65     uint8_t  test_id;
66     uint16_t cid;
67     struct net_buf_simple *fault_array;
68 };
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 /**
75  * @}
76  */
77 
78 #endif /* __BLE_MESH_HEALTH_CLI_H */
79