4 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
6 * @author: Anupam Roy <anupam.r@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #ifndef BT_SERVICE_MESH_NETWORK_H_
23 #define BT_SERVICE_MESH_NETWORK_H_
26 #include <sys/types.h>
27 #include "bluetooth-api.h"
28 #include "bluetooth-mesh-api.h"
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);
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],
43 int _bt_mesh_network_load(const char *app_cred,
44 const char *sender, const char *token);
46 int _bt_mesh_network_request_provisioning_data_request(
47 uint8_t net_uuid[], uint8_t count);
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);
53 int _bt_mesh_network_scan_cancel(const char *app_cred,
54 const char *sender, bluetooth_mesh_network_t *network);
56 bool _bt_mesh_is_scanning(void);
58 void _bt_mesh_set_scanning_state(bool state);
60 bool _bt_mesh_is_provisioning(void);
62 void _bt_mesh_set_provisioning_state(bool state);
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);
68 int _bt_mesh_network_provision_device(const char *app_cred,
70 bluetooth_mesh_provisioning_request_t *req);
72 int _bt_mesh_authentication_reply(int auth_type,
73 const char *auth_value, gboolean reply);
75 int _bt_mesh_network_add_netkey(const char *app_cred,
76 const char *sender, bluetooth_mesh_network_t *network);
78 int _bt_mesh_network_delete_netkey(const char *app_cred,
79 const char *sender, bluetooth_mesh_network_t *network,
82 int _bt_mesh_network_update_netkey(const char *app_cred,
83 const char *sender, bluetooth_mesh_network_t *network,
86 int _bt_mesh_network_add_appkey(const char *app_cred, const char *sender,
87 bluetooth_mesh_network_t *network, uint16_t netkey_idx);
89 int _bt_mesh_network_delete_appkey(const char *app_cred, const char *sender,
90 bluetooth_mesh_network_t *network, uint16_t netkey_idx,
93 int _bt_mesh_network_update_appkey(const char *app_cred, const char *sender,
94 bluetooth_mesh_network_t *network, uint16_t netkey_idx,
97 int _bt_mesh_network_set_name(const char *app_cred, const char *sender,
98 bluetooth_mesh_network_t *network);
100 int _bt_mesh_network_get_netkeys(const char *app_cred, const char *sender,
101 bluetooth_mesh_network_t *network, GArray **out_param);
103 int _bt_mesh_network_get_appkeys(const char *app_cred, const char *sender,
104 bluetooth_mesh_network_t *network, uint16_t net_idx,
107 int _bt_mesh_network_get_nodes(const char *app_cred, const char *sender,
108 bluetooth_mesh_network_t *network, GArray **out_param);
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);
114 int _bt_mesh_network_add_remote_node(uint8_t net_uuid[], uint8_t dev_uuid[],
115 uint16_t unicast, uint8_t count);
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);
121 bool _bt_mesh_network_save_remote_node_netkey(uint8_t net_uuid[],
122 uint16_t remote_unicast, uint16_t netkey_idx);
124 bool _bt_mesh_network_delete_remote_node_netkey(uint8_t net_uuid[],
125 uint16_t remote_unicast, uint16_t netkey_idx);
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);
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);
135 bool _bt_mesh_network_save_remote_node_ttl(uint8_t net_uuid[],
136 uint16_t remote_unicast, uint8_t ttl);
138 int _bt_mesh_network_node_get_netkeys(const char *app_cred,
139 bluetooth_mesh_node_discover_t *node,
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);
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);
149 int _bt_mesh_network_get_groups(const char *app_cred, const char *sender,
150 bluetooth_mesh_network_t *network, GArray **out_param);
152 bool _bt_mesh_network_get_label_uuid_from_sub_addr(uint8_t net_uuid[],
153 uint16_t sub_addr, uint8_t label[]);
155 bool _bt_mesh_node_get_vendor_features(uint8_t net_uuid[],
156 uint16_t unicast, bluetooth_mesh_node_features_t *feats);
160 #endif /* __cplusplus */
161 #endif /* BT_MESH_NETWORK_H_ */