NimBLE-Arduino 2.1.2
Loading...
Searching...
No Matches
cfg_cli.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 2017 Intel Corporation
7 *
8 * SPDX-License-Identifier: Apache-2.0
9 */
10#ifndef __BT_MESH_CFG_CLI_H
11#define __BT_MESH_CFG_CLI_H
12
20#ifdef __cplusplus
21extern "C" {
22#endif
23
26 struct bt_mesh_model *model;
27 struct bt_mesh_msg_ack_ctx ack_ctx;
28};
29
30extern const struct bt_mesh_model_op bt_mesh_cfg_cli_op[];
31extern const struct bt_mesh_model_cb bt_mesh_cfg_cli_cb;
32
33#define BT_MESH_MODEL_CFG_CLI(cli_data) \
34 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_CFG_CLI, bt_mesh_cfg_cli_op, NULL, \
35 cli_data, &bt_mesh_cfg_cli_cb)
36
37int bt_mesh_cfg_node_reset(uint16_t net_idx, uint16_t addr, bool *status);
38
39int bt_mesh_cfg_comp_data_get(uint16_t net_idx, uint16_t addr, uint8_t page,
40 uint8_t *rsp, struct os_mbuf *comp);
41
42int bt_mesh_cfg_beacon_get(uint16_t net_idx, uint16_t addr, uint8_t *status);
43
44int bt_mesh_cfg_krp_get(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx,
45 uint8_t *status, uint8_t *phase);
46
47int bt_mesh_cfg_krp_set(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx,
48 uint8_t transition, uint8_t *status, uint8_t *phase);
49
50int bt_mesh_cfg_beacon_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t *status);
51
52int bt_mesh_cfg_ttl_get(uint16_t net_idx, uint16_t addr, uint8_t *ttl);
53
54int bt_mesh_cfg_ttl_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t *ttl);
55
56int bt_mesh_cfg_friend_get(uint16_t net_idx, uint16_t addr, uint8_t *status);
57
58int bt_mesh_cfg_friend_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t *status);
59
60int bt_mesh_cfg_gatt_proxy_get(uint16_t net_idx, uint16_t addr, uint8_t *status);
61
62int bt_mesh_cfg_gatt_proxy_set(uint16_t net_idx, uint16_t addr, uint8_t val,
63 uint8_t *status);
64
65int bt_mesh_cfg_net_transmit_get(uint16_t net_idx, uint16_t addr,
66 uint8_t *transmit);
67
68int bt_mesh_cfg_net_transmit_set(uint16_t net_idx, uint16_t addr,
69 uint8_t val, uint8_t *transmit);
70
71int bt_mesh_cfg_relay_get(uint16_t net_idx, uint16_t addr, uint8_t *status,
72 uint8_t *transmit);
73
74int bt_mesh_cfg_relay_set(uint16_t net_idx, uint16_t addr, uint8_t new_relay,
75 uint8_t new_transmit, uint8_t *status, uint8_t *transmit);
76
77int bt_mesh_cfg_net_key_add(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx,
78 const uint8_t net_key[16], uint8_t *status);
79
80int bt_mesh_cfg_net_key_get(uint16_t net_idx, uint16_t addr, uint16_t *keys,
81 size_t *key_cnt);
82
83int bt_mesh_cfg_net_key_del(uint16_t net_idx, uint16_t addr,
84 uint16_t key_net_idx, uint8_t *status);
85
86int bt_mesh_cfg_app_key_add(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx,
87 uint16_t key_app_idx, const uint8_t app_key[16],
88 uint8_t *status);
89
90int bt_mesh_cfg_app_key_get(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx,
91 uint8_t *status, uint16_t *keys, size_t *key_cnt);
92
93int bt_mesh_cfg_app_key_del(uint16_t net_idx, uint16_t addr,
94 uint16_t key_net_idx, uint16_t key_app_idx, uint8_t *status);
95
96int bt_mesh_cfg_mod_app_bind(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
97 uint16_t mod_app_idx, uint16_t mod_id, uint8_t *status);
98
99int bt_mesh_cfg_mod_app_unbind(uint16_t net_idx, uint16_t addr,
100 uint16_t elem_addr, uint16_t mod_app_idx,
101 uint16_t mod_id, uint8_t *status);
102
103int bt_mesh_cfg_mod_app_bind_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
104 uint16_t mod_app_idx, uint16_t mod_id, uint16_t cid,
105 uint8_t *status);
106
107int bt_mesh_cfg_mod_app_unbind_vnd(uint16_t net_idx, uint16_t addr,
108 uint16_t elem_addr, uint16_t mod_app_idx, uint16_t mod_id,
109 uint16_t cid, uint8_t *status);
110
111int bt_mesh_cfg_mod_app_get(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
112 uint16_t mod_id, uint8_t *status, uint16_t *apps,
113 size_t *app_cnt);
114
115int bt_mesh_cfg_mod_app_get_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
116 uint16_t mod_id, uint16_t cid, uint8_t *status,
117 uint16_t *apps, size_t *app_cnt);
118
127#define BT_MESH_PUB_PERIOD_100MS(steps) ((steps) & BIT_MASK(6))
128
137#define BT_MESH_PUB_PERIOD_SEC(steps) (((steps) & BIT_MASK(6)) | (1 << 6))
138
148#define BT_MESH_PUB_PERIOD_10SEC(steps) (((steps) & BIT_MASK(6)) | (2 << 6))
149
159#define BT_MESH_PUB_PERIOD_10MIN(steps) (((steps) & BIT_MASK(6)) | (3 << 6))
160
161struct bt_mesh_cfg_mod_pub {
162 uint16_t addr;
163 const uint8_t *uuid;
164 uint16_t app_idx;
165 bool cred_flag;
166 uint8_t ttl;
167 uint8_t period;
168 uint8_t transmit;
169};
170
171int bt_mesh_cfg_mod_pub_get(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
172 uint16_t mod_id, struct bt_mesh_cfg_mod_pub *pub,
173 uint8_t *status);
174
175int bt_mesh_cfg_mod_pub_get_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
176 uint16_t mod_id, uint16_t cid,
177 struct bt_mesh_cfg_mod_pub *pub, uint8_t *status);
178
179int bt_mesh_cfg_mod_pub_set(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
180 uint16_t mod_id, struct bt_mesh_cfg_mod_pub *pub,
181 uint8_t *status);
182
183int bt_mesh_cfg_mod_pub_set_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
184 uint16_t mod_id, uint16_t cid,
185 struct bt_mesh_cfg_mod_pub *pub, uint8_t *status);
186
187int bt_mesh_cfg_mod_sub_add(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
188 uint16_t sub_addr, uint16_t mod_id, uint8_t *status);
189
190int bt_mesh_cfg_mod_sub_add_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
191 uint16_t sub_addr, uint16_t mod_id, uint16_t cid,
192 uint8_t *status);
193
194int bt_mesh_cfg_mod_sub_del(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
195 uint16_t sub_addr, uint16_t mod_id, uint8_t *status);
196
197int bt_mesh_cfg_mod_sub_del_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
198 uint16_t sub_addr, uint16_t mod_id, uint16_t cid,
199 uint8_t *status);
200
201int bt_mesh_cfg_mod_sub_overwrite(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
202 uint16_t sub_addr, uint16_t mod_id, uint8_t *status);
203
204int bt_mesh_cfg_mod_sub_overwrite_vnd(uint16_t net_idx, uint16_t addr,
205 uint16_t elem_addr, uint16_t sub_addr,
206 uint16_t mod_id, uint16_t cid, uint8_t *status);
207
208int bt_mesh_cfg_mod_sub_va_add(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
209 const uint8_t label[16], uint16_t mod_id,
210 uint16_t *virt_addr, uint8_t *status);
211
212int bt_mesh_cfg_mod_sub_va_add_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
213 const uint8_t label[16], uint16_t mod_id,
214 uint16_t cid, uint16_t *virt_addr, uint8_t *status);
215
216int bt_mesh_cfg_mod_sub_va_del(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
217 const uint8_t label[16], uint16_t mod_id,
218 uint16_t *virt_addr, uint8_t *status);
219
220int bt_mesh_cfg_mod_sub_va_del_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
221 const uint8_t label[16], uint16_t mod_id,
222 uint16_t cid, uint16_t *virt_addr, uint8_t *status);
223
224int bt_mesh_cfg_mod_sub_va_overwrite(uint16_t net_idx, uint16_t addr,
225 uint16_t elem_addr, const uint8_t label[16],
226 uint16_t mod_id, uint16_t *virt_addr,
227 uint8_t *status);
228
229int bt_mesh_cfg_mod_sub_va_overwrite_vnd(uint16_t net_idx, uint16_t addr,
230 uint16_t elem_addr, const uint8_t label[16],
231 uint16_t mod_id, uint16_t cid,
232 uint16_t *virt_addr, uint8_t *status);
233
234int bt_mesh_cfg_mod_sub_get(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
235 uint16_t mod_id, uint8_t *status, uint16_t *subs,
236 size_t *sub_cnt);
237
238int bt_mesh_cfg_mod_sub_get_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
239 uint16_t mod_id, uint16_t cid, uint8_t *status,
240 uint16_t *subs, size_t *sub_cnt);
241
242struct bt_mesh_cfg_hb_sub {
243 uint16_t src;
244 uint16_t dst;
245 uint8_t period;
246 uint8_t count;
247 uint8_t min;
248 uint8_t max;
249};
250
251int bt_mesh_cfg_hb_sub_set(uint16_t net_idx, uint16_t addr,
252 struct bt_mesh_cfg_hb_sub *sub, uint8_t *status);
253
254int bt_mesh_cfg_hb_sub_get(uint16_t net_idx, uint16_t addr,
255 struct bt_mesh_cfg_hb_sub *sub, uint8_t *status);
256
257struct bt_mesh_cfg_hb_pub {
258 uint16_t dst;
259 uint8_t count;
260 uint8_t period;
261 uint8_t ttl;
262 uint16_t feat;
263 uint16_t net_idx;
264};
265
266int bt_mesh_cfg_hb_pub_set(uint16_t net_idx, uint16_t addr,
267 const struct bt_mesh_cfg_hb_pub *pub, uint8_t *status);
268
269int bt_mesh_cfg_hb_pub_get(uint16_t net_idx, uint16_t addr,
270 struct bt_mesh_cfg_hb_pub *pub, uint8_t *status);
271
272int bt_mesh_cfg_mod_sub_del_all(uint16_t net_idx, uint16_t addr,
273 uint16_t elem_addr, uint16_t mod_id,
274 uint8_t *status);
275
276int bt_mesh_cfg_mod_sub_del_all_vnd(uint16_t net_idx, uint16_t addr,
277 uint16_t elem_addr, uint16_t mod_id,
278 uint16_t cid, uint8_t *status);
279
280int bt_mesh_cfg_net_key_update(uint16_t net_idx, uint16_t addr,
281 uint16_t key_net_idx, const uint8_t net_key[16],
282 uint8_t *status);
283
284int bt_mesh_cfg_app_key_update(uint16_t net_idx, uint16_t addr,
285 uint16_t key_net_idx, uint16_t key_app_idx,
286 const uint8_t app_key[16], uint8_t *status);
287
288int bt_mesh_cfg_node_identity_set(uint16_t net_idx, uint16_t addr,
289 uint16_t key_net_idx, uint8_t new_identity,
290 uint8_t *status, uint8_t *identity);
291
292int bt_mesh_cfg_node_identity_get(uint16_t net_idx, uint16_t addr,
293 uint16_t key_net_idx, uint8_t *status,
294 uint8_t *identity);
295
296int bt_mesh_cfg_lpn_timeout_get(uint16_t net_idx, uint16_t addr,
297 uint16_t unicast_addr, int32_t *polltimeout);
298
299int32_t bt_mesh_cfg_cli_timeout_get(void);
300void bt_mesh_cfg_cli_timeout_set(int32_t timeout);
301
302struct bt_mesh_comp_p0 {
304 uint16_t cid;
306 uint16_t pid;
308 uint16_t vid;
310 uint16_t crpl;
312 uint16_t feat;
313
314 struct os_mbuf *_buf;
315};
316
317struct bt_mesh_comp_p0_elem {
319 uint16_t loc;
321 size_t nsig;
323 size_t nvnd;
324
325 uint8_t *_buf;
326};
327
328int bt_mesh_comp_p0_get(struct bt_mesh_comp_p0 *comp,
329 struct os_mbuf *buf);
330
331struct bt_mesh_comp_p0_elem *bt_mesh_comp_p0_elem_pull(const struct bt_mesh_comp_p0 *comp,
332 struct bt_mesh_comp_p0_elem *elem);
333
334uint16_t bt_mesh_comp_p0_elem_mod(struct bt_mesh_comp_p0_elem *elem, int idx);
335
336struct bt_mesh_mod_id_vnd bt_mesh_comp_p0_elem_mod_vnd(struct bt_mesh_comp_p0_elem *elem, int idx);
337
338#ifdef __cplusplus
339}
340#endif
345#endif /* __BT_MESH_CFG_CLI_H */
Definition cfg_cli.h:25
Definition access.h:436
Definition access.h:380
Definition access.h:444
Definition msg.h:119
Definition os_mbuf.h:86