Zephyr API Documentation  2.7.0-rc2
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
144#define BT_MESH_HEALTH_PUB_DEFINE(_name, _max_faults) \
145 BT_MESH_MODEL_PUB_DEFINE(_name, NULL, (1 + 3 + (_max_faults)))
146
151
154
157};
158
171#define BT_MESH_MODEL_HEALTH_SRV(srv, pub) \
172 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_HEALTH_SRV, bt_mesh_health_srv_op, \
173 pub, srv, &bt_mesh_health_srv_cb)
174
186
188extern const struct bt_mesh_model_op bt_mesh_health_srv_op[];
189extern const struct bt_mesh_model_cb bt_mesh_health_srv_cb;
192#ifdef __cplusplus
193}
194#endif
195
200#endif /* ZEPHYR_INCLUDE_BLUETOOTH_MESH_HEALTH_SRV_H_ */
void
Definition: eswifi_shell.c:15
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:58
__UINT16_TYPE__ uint16_t
Definition: stdint.h:59
Definition: access.h:87
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:148
struct bt_mesh_model * model
Definition: health_srv.h:150
const struct bt_mesh_health_srv_cb * cb
Definition: health_srv.h:153
struct k_work_delayable attn_timer
Definition: health_srv.h:156
Definition: access.h:415
Definition: access.h:165
Definition: access.h:483
A structure used to submit work after a delay.
Definition: kernel.h:3651