• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file
2  *  @brief Bluetooth Mesh Configuration Server Model APIs.
3  */
4 
5 /*
6  * Copyright (c) 2017 Intel Corporation
7  *
8  * SPDX-License-Identifier: Apache-2.0
9  */
10 #ifndef __BT_MESH_CFG_SRV_H
11 #define __BT_MESH_CFG_SRV_H
12 
13 /**
14  * @brief Bluetooth Mesh
15  * @defgroup bt_mesh_cfg_srv Bluetooth Mesh Configuration Server Model
16  * @ingroup bt_mesh
17  * @{
18  */
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 /** Mesh Configuration Server Model Context */
25 struct bt_mesh_cfg_srv {
26     struct bt_mesh_model *model;
27 
28     u8_t net_transmit;         /* Network Transmit state */
29     u8_t relay;                /* Relay Mode state */
30     u8_t relay_retransmit;     /* Relay Retransmit state */
31     u8_t beacon;               /* Secure Network Beacon state */
32     u8_t gatt_proxy;           /* GATT Proxy state */
33     u8_t frnd;                 /* Friend state */
34     u8_t default_ttl;          /* Default TTL */
35 
36     /* Heartbeat Publication */
37     struct bt_mesh_hb_pub {
38         struct k_delayed_work timer;
39 
40         u16_t dst;
41         u16_t count;
42         u8_t  period;
43         u8_t  ttl;
44         u16_t feat;
45         u16_t net_idx;
46     } hb_pub;
47 
48     /* Heartbeat Subscription */
49     struct bt_mesh_hb_sub {
50         s64_t  expiry;
51 
52         u16_t src;
53         u16_t dst;
54         u16_t count;
55         u8_t  min_hops;
56         u8_t  max_hops;
57 
58         /* Optional subscription tracking function */
59         void (*func)(u8_t hops, u16_t feat);
60     } hb_sub;
61 };
62 
63 extern const struct bt_mesh_model_op bt_mesh_cfg_srv_op[];
64 extern const struct bt_mesh_model_cb bt_mesh_cfg_srv_cb;
65 
66 #define BT_MESH_MODEL_CFG_SRV(srv_data)                                        \
67     BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_CFG_SRV, bt_mesh_cfg_srv_op, NULL,   \
68              srv_data, &bt_mesh_cfg_srv_cb)
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 /**
75  * @}
76  */
77 
78 #endif /* __BT_MESH_CFG_SRV_H */
79