Lines Matching refs:bt_mesh_prov_link

31 struct bt_mesh_prov_link bt_mesh_prov_link;  variable
35 BUILD_ASSERT(sizeof(bt_mesh_prov_link.conf_inputs) == 145,
41 const size_t offset = offsetof(struct bt_mesh_prov_link, addr); in bt_mesh_prov_reset_state()
43 atomic_clear(bt_mesh_prov_link.flags); in bt_mesh_prov_reset_state()
44 (void)memset((uint8_t *)&bt_mesh_prov_link + offset, 0, in bt_mesh_prov_reset_state()
45 sizeof(bt_mesh_prov_link) - offset); in bt_mesh_prov_reset_state()
141 memcpy(bt_mesh_prov_link.auth, str, size); in get_auth_string()
142 memset(bt_mesh_prov_link.auth + size, 0, in get_auth_string()
143 sizeof(bt_mesh_prov_link.auth) - size); in get_auth_string()
166 sys_put_be32(num, &bt_mesh_prov_link.auth[auth_size - sizeof(num)]); in get_auth_number()
167 memset(bt_mesh_prov_link.auth, 0, auth_size - sizeof(num)); in get_auth_number()
185 (void)memset(bt_mesh_prov_link.auth, 0, auth_size); in bt_mesh_prov_auth()
192 atomic_set_bit(bt_mesh_prov_link.flags, OOB_STATIC_KEY); in bt_mesh_prov_auth()
202 atomic_set_bit(bt_mesh_prov_link.flags, WAIT_STRING); in bt_mesh_prov_auth()
205 atomic_set_bit(bt_mesh_prov_link.flags, WAIT_NUMBER); in bt_mesh_prov_auth()
219 atomic_set_bit(bt_mesh_prov_link.flags, NOTIFY_INPUT_COMPLETE); in bt_mesh_prov_auth()
224 atomic_set_bit(bt_mesh_prov_link.flags, NOTIFY_INPUT_COMPLETE); in bt_mesh_prov_auth()
238 atomic_set_bit(bt_mesh_prov_link.flags, WAIT_STRING); in bt_mesh_prov_auth()
240 atomic_set_bit(bt_mesh_prov_link.flags, WAIT_NUMBER); in bt_mesh_prov_auth()
249 atomic_set_bit(bt_mesh_prov_link.flags, NOTIFY_INPUT_COMPLETE); in bt_mesh_prov_auth()
254 atomic_set_bit(bt_mesh_prov_link.flags, NOTIFY_INPUT_COMPLETE); in bt_mesh_prov_auth()
270 if (!atomic_test_and_clear_bit(bt_mesh_prov_link.flags, WAIT_NUMBER)) { in bt_mesh_input_number()
274 sys_put_be32(num, &bt_mesh_prov_link.auth[auth_size - sizeof(num)]); in bt_mesh_input_number()
276 bt_mesh_prov_link.role->input_complete(); in bt_mesh_input_number()
286 strlen(str) > bt_mesh_prov_link.oob_size) { in bt_mesh_input_string()
290 if (!atomic_test_and_clear_bit(bt_mesh_prov_link.flags, WAIT_STRING)) { in bt_mesh_input_string()
294 memcpy(bt_mesh_prov_link.auth, str, strlen(str)); in bt_mesh_input_string()
296 bt_mesh_prov_link.role->input_complete(); in bt_mesh_input_string()
308 return atomic_test_bit(bt_mesh_prov_link.flags, LINK_ACTIVE); in bt_mesh_prov_active()
331 if (type >= ARRAY_SIZE(bt_mesh_prov_link.role->op)) { in prov_recv()
333 bt_mesh_prov_link.role->error(PROV_ERR_NVAL_PDU); in prov_recv()
337 if ((type != PROV_FAILED && type != bt_mesh_prov_link.expect) || in prov_recv()
338 !bt_mesh_prov_link.role->op[type]) { in prov_recv()
339 LOG_WRN("Unexpected msg 0x%02x != 0x%02x", type, bt_mesh_prov_link.expect); in prov_recv()
340 bt_mesh_prov_link.role->error(PROV_ERR_UNEXP_PDU); in prov_recv()
353 bt_mesh_prov_link.role->error(PROV_ERR_NVAL_FMT); in prov_recv()
357 bt_mesh_prov_link.role->op[type](&buf->data[1]); in prov_recv()
362 atomic_set_bit(bt_mesh_prov_link.flags, LINK_ACTIVE); in prov_link_opened()
368 bt_mesh_prov_link.bearer = bearer; in prov_link_opened()
370 if (bt_mesh_prov_link.role->link_opened) { in prov_link_opened()
371 bt_mesh_prov_link.role->link_opened(); in prov_link_opened()
380 if (bt_mesh_prov_link.role->link_closed) { in prov_link_closed()
381 bt_mesh_prov_link.role->link_closed(reason); in prov_link_closed()
392 if (bt_mesh_prov_link.role->error) { in prov_bearer_error()
393 bt_mesh_prov_link.role->error(err); in prov_bearer_error()