NimBLE-Arduino 2.1.2
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 __BT_MESH_HEALTH_SRV_H
11#define __BT_MESH_HEALTH_SRV_H
12
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24struct bt_mesh_health_srv_cb {
25 /* Fetch current faults */
26 int (*fault_get_cur)(struct bt_mesh_model *model, uint8_t *test_id,
27 uint16_t *company_id, uint8_t *faults,
28 uint8_t *fault_count);
29
30 /* Fetch registered faults */
31 int (*fault_get_reg)(struct bt_mesh_model *model, uint16_t company_id,
32 uint8_t *test_id, uint8_t *faults,
33 uint8_t *fault_count);
34
35 /* Clear registered faults */
36 int (*fault_clear)(struct bt_mesh_model *model, uint16_t company_id);
37
38 /* Run a specific test */
39 int (*fault_test)(struct bt_mesh_model *model, uint8_t test_id,
40 uint16_t company_id);
41
42 /* Attention on */
43 void (*attn_on)(struct bt_mesh_model *model);
44
45 /* Attention off */
46 void (*attn_off)(struct bt_mesh_model *model);
47};
48
57#define BT_MESH_HEALTH_FAULT_MSG(max_faults) \
58 NET_BUF_SIMPLE(1 + 3 + (max_faults))
59
62 struct bt_mesh_model *model;
63
64 /* Optional callback struct */
65 const struct bt_mesh_health_srv_cb *cb;
66
67 /* Attention Timer state */
68 struct k_work_delayable attn_timer;
69};
70
71int bt_mesh_fault_update(struct bt_mesh_elem *elem);
72
73extern const struct bt_mesh_model_op bt_mesh_health_srv_op[];
74extern const struct bt_mesh_model_cb bt_mesh_health_srv_cb;
75
88#define BT_MESH_MODEL_HEALTH_SRV(srv, pub) \
89 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_HEALTH_SRV, bt_mesh_health_srv_op, \
90 pub, srv, &bt_mesh_health_srv_cb)
91
92#ifdef __cplusplus
93}
94#endif
95
100#endif /* __BT_MESH_HEALTH_SRV_H */
Definition access.h:70
Definition health_srv.h:61
Definition access.h:380
Definition access.h:444