10#ifndef __BT_MESH_CFG_CLI_H
11#define __BT_MESH_CFG_CLI_H
30extern const struct bt_mesh_model_op bt_mesh_cfg_cli_op[];
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)
37int bt_mesh_cfg_node_reset(uint16_t net_idx, uint16_t addr,
bool *status);
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);
42int bt_mesh_cfg_beacon_get(uint16_t net_idx, uint16_t addr, uint8_t *status);
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);
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);
50int bt_mesh_cfg_beacon_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t *status);
52int bt_mesh_cfg_ttl_get(uint16_t net_idx, uint16_t addr, uint8_t *ttl);
54int bt_mesh_cfg_ttl_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t *ttl);
56int bt_mesh_cfg_friend_get(uint16_t net_idx, uint16_t addr, uint8_t *status);
58int bt_mesh_cfg_friend_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t *status);
60int bt_mesh_cfg_gatt_proxy_get(uint16_t net_idx, uint16_t addr, uint8_t *status);
62int bt_mesh_cfg_gatt_proxy_set(uint16_t net_idx, uint16_t addr, uint8_t val,
65int bt_mesh_cfg_net_transmit_get(uint16_t net_idx, uint16_t addr,
68int bt_mesh_cfg_net_transmit_set(uint16_t net_idx, uint16_t addr,
69 uint8_t val, uint8_t *transmit);
71int bt_mesh_cfg_relay_get(uint16_t net_idx, uint16_t addr, uint8_t *status,
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);
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);
80int bt_mesh_cfg_net_key_get(uint16_t net_idx, uint16_t addr, uint16_t *keys,
83int bt_mesh_cfg_net_key_del(uint16_t net_idx, uint16_t addr,
84 uint16_t key_net_idx, uint8_t *status);
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],
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);
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);
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);
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);
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,
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);
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,
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);
127#define BT_MESH_PUB_PERIOD_100MS(steps) ((steps) & BIT_MASK(6))
137#define BT_MESH_PUB_PERIOD_SEC(steps) (((steps) & BIT_MASK(6)) | (1 << 6))
148#define BT_MESH_PUB_PERIOD_10SEC(steps) (((steps) & BIT_MASK(6)) | (2 << 6))
159#define BT_MESH_PUB_PERIOD_10MIN(steps) (((steps) & BIT_MASK(6)) | (3 << 6))
161struct bt_mesh_cfg_mod_pub {
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,
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);
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,
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);
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);
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,
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);
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,
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);
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);
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);
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);
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);
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);
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,
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);
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,
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);
242struct bt_mesh_cfg_hb_sub {
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);
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);
257struct bt_mesh_cfg_hb_pub {
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);
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);
272int bt_mesh_cfg_mod_sub_del_all(uint16_t net_idx, uint16_t addr,
273 uint16_t elem_addr, uint16_t mod_id,
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);
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],
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);
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);
292int bt_mesh_cfg_node_identity_get(uint16_t net_idx, uint16_t addr,
293 uint16_t key_net_idx, uint8_t *status,
296int bt_mesh_cfg_lpn_timeout_get(uint16_t net_idx, uint16_t addr,
297 uint16_t unicast_addr, int32_t *polltimeout);
299int32_t bt_mesh_cfg_cli_timeout_get(
void);
300void bt_mesh_cfg_cli_timeout_set(int32_t timeout);
302struct bt_mesh_comp_p0 {
317struct bt_mesh_comp_p0_elem {
328int bt_mesh_comp_p0_get(
struct bt_mesh_comp_p0 *comp,
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);
334uint16_t bt_mesh_comp_p0_elem_mod(
struct bt_mesh_comp_p0_elem *elem,
int idx);
336struct bt_mesh_mod_id_vnd bt_mesh_comp_p0_elem_mod_vnd(struct bt_mesh_comp_p0_elem *elem,
int idx);