Mesh: Implement Configuration Client
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / services / include / bt-service-mesh-network.h
1 /*
2  * Bluetooth-frwk
3  *
4  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
5  *
6  * @author: Anupam Roy <anupam.r@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *              http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #ifndef BT_SERVICE_MESH_NETWORK_H_
23 #define BT_SERVICE_MESH_NETWORK_H_
24
25 #include <glib.h>
26 #include <sys/types.h>
27 #include "bluetooth-api.h"
28 #include "bluetooth-mesh-api.h"
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 int _bt_mesh_network_create(const char *app_key,
35                 const char *sender, const char *network_name,
36                         bluetooth_mesh_node_t *node, GSList *model_list);
37
38 int _bt_mesh_network_create_cdb(int result,
39                 const char *sender, const char *app_creds,
40                         uint8_t uuid[16], uint8_t token[8],
41                                 const char *network);
42
43 int _bt_mesh_network_load(const char *app_cred,
44                 const char *sender, const char *token);
45
46 int _bt_mesh_network_request_provisioning_data_request(
47                 uint8_t net_uuid[], uint8_t count);
48
49 int _bt_mesh_network_scan(const char *app_cred, const char *sender,
50                 bluetooth_mesh_network_t *network,
51                         bluetooth_mesh_scan_param_t *param);
52
53 int _bt_mesh_network_scan_cancel(const char *app_cred,
54                 const char *sender, bluetooth_mesh_network_t *network);
55
56 bool _bt_mesh_is_scanning(void);
57
58 void _bt_mesh_set_scanning_state(bool state);
59
60 bool _bt_mesh_is_provisioning(void);
61
62 void _bt_mesh_set_provisioning_state(bool state);
63
64 int _bt_mesh_network_set_provisioner_caps(const char *app_cred,
65                 const char *sender, bluetooth_mesh_network_t *network,
66                         bluetooth_mesh_provisioner_caps_t *caps);
67
68 int _bt_mesh_network_provision_device(const char *app_cred,
69                 const char *sender,
70                         bluetooth_mesh_provisioning_request_t *req);
71
72 int _bt_mesh_authentication_reply(int auth_type,
73                 const char *auth_value, gboolean reply);
74
75 int _bt_mesh_network_add_netkey(const char *app_cred,
76                 const char *sender, bluetooth_mesh_network_t *network);
77
78 int _bt_mesh_network_delete_netkey(const char *app_cred,
79                 const char *sender, bluetooth_mesh_network_t *network,
80                         uint16_t index);
81
82 int _bt_mesh_network_update_netkey(const char *app_cred,
83                 const char *sender, bluetooth_mesh_network_t *network,
84                         uint16_t index);
85
86 int _bt_mesh_network_add_appkey(const char *app_cred, const char *sender,
87                 bluetooth_mesh_network_t *network, uint16_t netkey_idx);
88
89 int _bt_mesh_network_delete_appkey(const char *app_cred, const char *sender,
90                 bluetooth_mesh_network_t *network, uint16_t netkey_idx,
91                         uint16_t appkey_idx);
92
93 int _bt_mesh_network_update_appkey(const char *app_cred, const char *sender,
94                 bluetooth_mesh_network_t *network, uint16_t netkey_idx,
95                         uint16_t appkey_idx);
96
97 int _bt_mesh_network_set_name(const char *app_cred, const char *sender,
98                 bluetooth_mesh_network_t *network);
99
100 int _bt_mesh_network_get_netkeys(const char *app_cred, const char *sender,
101                  bluetooth_mesh_network_t *network,  GArray **out_param);
102
103 int _bt_mesh_network_get_appkeys(const char *app_cred, const char *sender,
104                 bluetooth_mesh_network_t *network,  uint16_t net_idx,
105                         GArray **out_param);
106
107 int _bt_mesh_network_get_nodes(const char *app_cred, const char *sender,
108                 bluetooth_mesh_network_t *network,  GArray **out_param);
109
110 int _bt_mesh_element_get_models(const char *app_cred, const char *sender,
111                 bluetooth_mesh_network_t *network,  uint16_t unicast,
112                         int elem_idx, GArray **out_param);
113
114 int _bt_mesh_network_add_remote_node(uint8_t net_uuid[], uint8_t dev_uuid[],
115                 uint16_t unicast, uint8_t count);
116
117 bool _bt_mesh_network_save_remote_node_composition(uint8_t net_uuid[],
118                 uint16_t remote_unicast,
119                         uint8_t *data, uint16_t data_len);
120
121 bool _bt_mesh_network_save_remote_node_netkey(uint8_t net_uuid[],
122                 uint16_t remote_unicast, uint16_t netkey_idx);
123
124 bool _bt_mesh_network_delete_remote_node_netkey(uint8_t net_uuid[],
125                 uint16_t remote_unicast, uint16_t netkey_idx);
126
127 bool _bt_mesh_network_save_remote_node_appkey(uint8_t net_uuid[],
128                 uint16_t remote_unicast, uint16_t netkey_idx,
129                         uint16_t appkey_idx);
130
131 bool _bt_mesh_network_delete_remote_node_appkey(uint8_t net_uuid[],
132                 uint16_t remote_unicast, uint16_t netkey_idx,
133                         uint16_t appkey_idx);
134
135 bool _bt_mesh_network_save_remote_node_ttl(uint8_t net_uuid[],
136                 uint16_t remote_unicast, uint8_t ttl);
137
138 int _bt_mesh_network_node_get_netkeys(const char *app_cred,
139                 bluetooth_mesh_node_discover_t *node,
140                         GArray **out_param);
141
142 int _bt_mesh_network_node_get_appkeys(const char *app_cred, const char *sender,
143                 bluetooth_mesh_node_discover_t *node,  GArray **out_param);
144
145 int _bt_mesh_network_create_group(const char *app_cred, const char *sender,
146                 bluetooth_mesh_network_t *net, bool is_virtual, uint16_t grp_addr,
147                         bluetooth_mesh_network_group_info_t *group);
148
149 int _bt_mesh_network_get_groups(const char *app_cred, const char *sender,
150                 bluetooth_mesh_network_t *network,  GArray **out_param);
151
152 bool _bt_mesh_network_get_label_uuid_from_sub_addr(uint8_t net_uuid[],
153                 uint16_t sub_addr, uint8_t label[]);
154
155 bool _bt_mesh_node_get_vendor_features(uint8_t net_uuid[],
156                 uint16_t unicast, bluetooth_mesh_node_features_t *feats);
157
158 #ifdef __cplusplus
159 }
160 #endif /* __cplusplus */
161 #endif /* BT_MESH_NETWORK_H_ */