NimBLE-Arduino 2.1.2
Loading...
Searching...
No Matches
model_srv.h
1/*
2 * Copyright (c) 2017 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef __MODEL_SRV_H__
8#define __MODEL_SRV_H__
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14struct bt_mesh_gen_onoff_srv {
15 struct bt_mesh_model *model;
16
17 int (*get)(struct bt_mesh_model *model, uint8_t *state);
18 int (*set)(struct bt_mesh_model *model, uint8_t state);
19};
20
21extern const struct bt_mesh_model_op gen_onoff_srv_op[];
22extern const struct bt_mesh_model_cb gen_onoff_srv_cb;
23
24#define BT_MESH_MODEL_GEN_ONOFF_SRV(srv, pub) \
25 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_GEN_ONOFF_SRV, \
26 gen_onoff_srv_op, pub, srv, &gen_onoff_srv_cb)
27
28struct bt_mesh_gen_level_srv {
29 struct bt_mesh_model *model;
30
31 int (*get)(struct bt_mesh_model *model, int16_t *level);
32 int (*set)(struct bt_mesh_model *model, int16_t level);
33};
34
35extern const struct bt_mesh_model_op gen_level_srv_op[];
36extern const struct bt_mesh_model_cb gen_level_srv_cb;
37
38#define BT_MESH_MODEL_GEN_LEVEL_SRV(srv, pub) \
39 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_GEN_LEVEL_SRV, \
40 gen_level_srv_op, pub, srv, &gen_level_srv_cb)
41
42struct bt_mesh_light_lightness_srv {
43 struct bt_mesh_model *model;
44
45 int (*get)(struct bt_mesh_model *model, int16_t *level);
46 int (*set)(struct bt_mesh_model *model, int16_t level);
47};
48
49extern const struct bt_mesh_model_op light_lightness_srv_op[];
50extern const struct bt_mesh_model_cb light_lightness_srv_cb;
51
52#define BT_MESH_MODEL_LIGHT_LIGHTNESS_SRV(srv, pub) \
53 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_SRV, \
54 light_lightness_srv_op, pub, srv, &light_lightness_srv_cb)
55
56void bt_mesh_set_gen_onoff_srv_cb(int (*get)(struct bt_mesh_model *model, uint8_t *state),
57 int (*set)(struct bt_mesh_model *model, uint8_t state));
58void bt_mesh_set_gen_level_srv_cb(int (*get)(struct bt_mesh_model *model, int16_t *level),
59 int (*set)(struct bt_mesh_model *model, int16_t level));
60void bt_mesh_set_light_lightness_srv_cb(int (*get)(struct bt_mesh_model *model, int16_t *level),
61 int (*set)(struct bt_mesh_model *model, int16_t level));
62
63#ifdef __cplusplus
64}
65#endif
66
67#endif /* __MODEL_SRV_H__ */
Definition access.h:380
Definition access.h:444