Zephyr API 3.6.99
Loading...
Searching...
No Matches
health_srv.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 2017 Intel Corporation
7 *
8 * SPDX-License-Identifier: Apache-2.0
9 */
10#ifndef ZEPHYR_INCLUDE_BLUETOOTH_MESH_HEALTH_SRV_H_
11#define ZEPHYR_INCLUDE_BLUETOOTH_MESH_HEALTH_SRV_H_
12
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
56 int (*fault_get_cur)(const struct bt_mesh_model *model, uint8_t *test_id,
57 uint16_t *company_id, uint8_t *faults,
58 uint8_t *fault_count);
59
82 int (*fault_get_reg)(const struct bt_mesh_model *model, uint16_t company_id,
83 uint8_t *test_id, uint8_t *faults,
84 uint8_t *fault_count);
85
94 int (*fault_clear)(const struct bt_mesh_model *model, uint16_t company_id);
95
111 int (*fault_test)(const struct bt_mesh_model *model, uint8_t test_id,
112 uint16_t company_id);
113
128 void (*attn_on)(const struct bt_mesh_model *model);
129
137 void (*attn_off)(const struct bt_mesh_model *model);
138};
139
146#define BT_MESH_HEALTH_PUB_DEFINE(_name, _max_faults) \
147 BT_MESH_MODEL_PUB_DEFINE(_name, NULL, (1 + 3 + (_max_faults)))
148
152 const struct bt_mesh_model *model;
153
156
159};
160
175#define BT_MESH_MODEL_HEALTH_SRV(srv, pub, ...) \
176 BT_MESH_MODEL_METADATA_CB(BT_MESH_MODEL_ID_HEALTH_SRV, \
177 bt_mesh_health_srv_op, \
178 pub, \
179 srv, \
180 &bt_mesh_health_srv_cb, __VA_ARGS__)
181
186#define BT_MESH_HEALTH_TEST_INFO_METADATA_ID 0x0000
187
188#define BT_MESH_HEALTH_TEST_INFO_METADATA(tests) \
189 { \
190 .len = ARRAY_SIZE(tests), \
191 .id = BT_MESH_HEALTH_TEST_INFO_METADATA_ID, \
192 .data = tests, \
193 }
194
204#define BT_MESH_HEALTH_TEST_INFO(cid, tests...) \
205 BT_BYTES_LIST_LE16(cid), sizeof((uint8_t[]){ tests }), tests
206
218
220extern const struct bt_mesh_model_op bt_mesh_health_srv_op[];
221extern const struct bt_mesh_model_cb bt_mesh_health_srv_cb;
224#ifdef __cplusplus
225}
226#endif
227
232#endif /* ZEPHYR_INCLUDE_BLUETOOTH_MESH_HEALTH_SRV_H_ */
Bluetooth byteorder API.
int bt_mesh_health_srv_fault_update(const struct bt_mesh_elem *elem)
Notify the stack that the fault array state of the given element has changed.
Bluetooth Mesh Profile APIs.
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Abstraction that describes a Mesh Element.
Definition access.h:154
Callback function for the Health Server model.
Definition health_srv.h:28
int(* fault_get_cur)(const 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.
Definition health_srv.h:56
int(* fault_get_reg)(const 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.
Definition health_srv.h:82
int(* fault_test)(const struct bt_mesh_model *model, uint8_t test_id, uint16_t company_id)
Run a self-test.
Definition health_srv.h:111
void(* attn_off)(const struct bt_mesh_model *model)
Stop the attention state.
Definition health_srv.h:137
void(* attn_on)(const struct bt_mesh_model *model)
Start calling attention to the device.
Definition health_srv.h:128
int(* fault_clear)(const struct bt_mesh_model *model, uint16_t company_id)
Clear all registered faults associated with the given Company ID.
Definition health_srv.h:94
Mesh Health Server Model Context.
Definition health_srv.h:150
const struct bt_mesh_health_srv_cb * cb
Optional callback struct.
Definition health_srv.h:155
struct k_work_delayable attn_timer
Attention Timer state.
Definition health_srv.h:158
const struct bt_mesh_model * model
Composition data model entry pointer.
Definition health_srv.h:152
Model callback functions.
Definition access.h:813
Model opcode handler.
Definition access.h:363
Abstraction that describes a Mesh Model instance.
Definition access.h:891
A structure used to submit work after a delay.
Definition kernel.h:3985