• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2017 Intel Corporation
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef __MODEL_CLI_H__
8 #define __MODEL_CLI_H__
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 struct bt_mesh_gen_model_cli {
15     struct bt_mesh_model *model;
16 
17     struct k_sem          op_sync;
18     u32_t                 op_pending;
19     void                 *op_param;
20 };
21 
22 extern const struct bt_mesh_model_op gen_onoff_cli_op[];
23 extern const struct bt_mesh_model_cb bt_mesh_gen_onoff_cli_cb;
24 
25 #define BT_MESH_MODEL_GEN_ONOFF_CLI(cli_data, pub)                             \
26     BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_GEN_ONOFF_CLI, gen_onoff_cli_op, pub,    \
27              cli_data, &bt_mesh_gen_onoff_cli_cb)
28 
29 extern const struct bt_mesh_model_op gen_level_cli_op[];
30 extern const struct bt_mesh_model_cb bt_mesh_gen_level_cli_cb;
31 
32 #define BT_MESH_MODEL_GEN_LEVEL_CLI(cli_data, pub)                             \
33     BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_GEN_LEVEL_CLI, gen_level_cli_op, pub,    \
34              cli_data, &bt_mesh_gen_level_cli_cb)
35 
36 int bt_mesh_gen_onoff_get(u16_t net_idx, u16_t addr, u16_t app_idx,
37                           u8_t *state);
38 int bt_mesh_gen_onoff_set(u16_t net_idx, u16_t addr, u16_t app_idx,
39                           u8_t val, u8_t *state);
40 int bt_mesh_gen_level_get(u16_t net_idx, u16_t addr, u16_t app_idx,
41                           s16_t *level);
42 int bt_mesh_gen_level_set(u16_t net_idx, u16_t addr, u16_t app_idx,
43                           s16_t val, s16_t *state);
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 
49 #endif /* __MODEL_CLI_H__ */
50