Zephyr Project API  3.3.0
A Scalable Open Source RTOS
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
20#ifdef __cplusplus
21extern "C" {
22#endif
23
53 int (*fault_get_cur)(struct bt_mesh_model *model, uint8_t *test_id,
54 uint16_t *company_id, uint8_t *faults,
55 uint8_t *fault_count);
56
79 int (*fault_get_reg)(struct bt_mesh_model *model, uint16_t company_id,
80 uint8_t *test_id, uint8_t *faults,
81 uint8_t *fault_count);
82
91 int (*fault_clear)(struct bt_mesh_model *model, uint16_t company_id);
92
108 int (*fault_test)(struct bt_mesh_model *model, uint8_t test_id,
109 uint16_t company_id);
110
125 void (*attn_on)(struct bt_mesh_model *model);
126
134 void (*attn_off)(struct bt_mesh_model *model);
135};
136
143#define BT_MESH_HEALTH_PUB_DEFINE(_name, _max_faults) \
144 BT_MESH_MODEL_PUB_DEFINE(_name, NULL, (1 + 3 + (_max_faults)))
145
150
153
156};
157
169#define BT_MESH_MODEL_HEALTH_SRV(srv, pub) \
170 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_HEALTH_SRV, bt_mesh_health_srv_op, \
171 pub, srv, &bt_mesh_health_srv_cb)
172
183__deprecated int bt_mesh_fault_update(struct bt_mesh_elem *elem);
184
196
198extern const struct bt_mesh_model_op bt_mesh_health_srv_op[];
199extern const struct bt_mesh_model_cb bt_mesh_health_srv_cb;
202#ifdef __cplusplus
203}
204#endif
205
210#endif /* ZEPHYR_INCLUDE_BLUETOOTH_MESH_HEALTH_SRV_H_ */
int bt_mesh_health_srv_fault_update(struct bt_mesh_elem *elem)
Notify the stack that the fault array state of the given element has changed.
int bt_mesh_fault_update(struct bt_mesh_elem *elem)
Notify the stack that the fault array state of the given element has changed.
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
Definition: access.h:107
Definition: health_srv.h:25
int(* fault_clear)(struct bt_mesh_model *model, uint16_t company_id)
Clear all registered faults associated with the given Company ID.
Definition: health_srv.h:91
void(* attn_off)(struct bt_mesh_model *model)
Stop the attention state.
Definition: health_srv.h:134
int(* fault_test)(struct bt_mesh_model *model, uint8_t test_id, uint16_t company_id)
Run a self-test.
Definition: health_srv.h:108
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.
Definition: health_srv.h:53
void(* attn_on)(struct bt_mesh_model *model)
Start calling attention to the device.
Definition: health_srv.h:125
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.
Definition: health_srv.h:79
Definition: health_srv.h:147
struct bt_mesh_model * model
Definition: health_srv.h:149
const struct bt_mesh_health_srv_cb * cb
Definition: health_srv.h:152
struct k_work_delayable attn_timer
Definition: health_srv.h:155
Definition: access.h:492
Definition: access.h:185
Definition: access.h:560
A structure used to submit work after a delay.
Definition: kernel.h:3735