1 /** @file 2 * @brief Bluetooth Mesh Health Client Model APIs. 3 */ 4 5 /* 6 * Copyright (c) 2017 Intel Corporation 7 * 8 * SPDX-License-Identifier: Apache-2.0 9 */ 10 #ifndef __BT_MESH_HEALTH_CLI_H 11 #define __BT_MESH_HEALTH_CLI_H 12 13 /** 14 * @brief Bluetooth Mesh 15 * @defgroup bt_mesh_health_cli Bluetooth Mesh Health Client Model 16 * @ingroup bt_mesh 17 * @{ 18 */ 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 24 /** Mesh Health Client Model Context */ 25 struct bt_mesh_health_cli { 26 struct bt_mesh_model *model; 27 28 void (*current_status)(struct bt_mesh_health_cli *cli, u16_t addr, 29 u8_t test_id, u16_t cid, u8_t *faults, 30 size_t fault_count); 31 32 struct k_sem op_sync; 33 u32_t op_pending; 34 void *op_param; 35 }; 36 37 extern const struct bt_mesh_model_op bt_mesh_health_cli_op[]; 38 extern const struct bt_mesh_model_cb bt_mesh_health_cli_cb; 39 40 #define BT_MESH_MODEL_HEALTH_CLI(cli_data) \ 41 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_HEALTH_CLI, bt_mesh_health_cli_op, \ 42 NULL, cli_data, &bt_mesh_health_cli_cb) 43 44 int bt_mesh_health_cli_set(struct bt_mesh_model *model); 45 46 int bt_mesh_health_fault_get(u16_t net_idx, u16_t addr, u16_t app_idx, 47 u16_t cid, u8_t *test_id, u8_t *faults, 48 size_t *fault_count); 49 50 int bt_mesh_health_fault_clear(u16_t net_idx, u16_t addr, u16_t app_idx, 51 u16_t cid, u8_t *test_id, u8_t *faults, 52 size_t *fault_count); 53 54 int bt_mesh_health_fault_test(u16_t net_idx, u16_t addr, u16_t app_idx, 55 u16_t cid, u8_t test_id, u8_t *faults, 56 size_t *fault_count); 57 58 int bt_mesh_health_period_get(u16_t net_idx, u16_t addr, u16_t app_idx, 59 u8_t *divisor); 60 61 int bt_mesh_health_period_set(u16_t net_idx, u16_t addr, u16_t app_idx, 62 u8_t divisor, u8_t *updated_divisor); 63 64 int bt_mesh_health_attention_get(u16_t net_idx, u16_t addr, u16_t app_idx, 65 u8_t *attention); 66 67 int bt_mesh_health_attention_set(u16_t net_idx, u16_t addr, u16_t app_idx, 68 u8_t attention, u8_t *updated_attention); 69 70 s32_t bt_mesh_health_cli_timeout_get(void); 71 void bt_mesh_health_cli_timeout_set(s32_t timeout); 72 73 #ifdef __cplusplus 74 } 75 #endif 76 77 /** 78 * @} 79 */ 80 81 #endif /* __BT_MESH_HEALTH_CLI_H */ 82