Lines Matching +full:num +full:- +full:inputs
5 * SPDX-License-Identifier: Apache-2.0
36 "Confirmation inputs shall be 145 bytes");
45 sizeof(bt_mesh_prov_link) - offset); in bt_mesh_prov_reset_state()
92 return -EINVAL; in check_output_auth()
95 if (!(bt_mesh_prov->output_actions & output)) { in check_output_auth()
96 return -EINVAL; in check_output_auth()
99 if (size > bt_mesh_prov->output_size) { in check_output_auth()
100 return -EINVAL; in check_output_auth()
109 return -EINVAL; in check_input_auth()
112 if (!(bt_mesh_prov->input_actions & input)) { in check_input_auth()
113 return -EINVAL; in check_input_auth()
116 if (size > bt_mesh_prov->input_size) { in check_input_auth()
117 return -EINVAL; in check_input_auth()
132 /* pull base-36 digits: */ in get_auth_string()
143 sizeof(bt_mesh_prov_link.auth) - size); in get_auth_string()
152 uint32_t num = 0; in get_auth_number() local
154 bt_rand(&num, sizeof(num)); in get_auth_number()
161 num = (num % (divider[size - 1] - 1)) + 1; in get_auth_number()
163 num %= divider[size - 1]; in get_auth_number()
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()
169 return num; in get_auth_number()
182 return -EINVAL; in bt_mesh_prov_auth()
189 return -EINVAL; in bt_mesh_prov_auth()
208 return bt_mesh_prov->input(input, size); in bt_mesh_prov_auth()
221 return bt_mesh_prov->output_string(str); in bt_mesh_prov_auth()
225 return bt_mesh_prov->output_number(output, in bt_mesh_prov_auth()
243 return bt_mesh_prov->input(input, size); in bt_mesh_prov_auth()
251 return bt_mesh_prov->output_string(str); in bt_mesh_prov_auth()
256 return bt_mesh_prov->output_number(output, in bt_mesh_prov_auth()
260 return -EINVAL; in bt_mesh_prov_auth()
264 int bt_mesh_input_number(uint32_t num) in bt_mesh_input_number() argument
268 LOG_DBG("%u", num); in bt_mesh_input_number()
271 return -EINVAL; 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()
287 return -ENOTSUP; in bt_mesh_input_string()
291 return -EINVAL; in bt_mesh_input_string()
296 bt_mesh_prov_link.role->input_complete(); in bt_mesh_input_string()
327 uint8_t type = buf->data[0]; in prov_recv()
329 LOG_DBG("type 0x%02x len %u", type, buf->len); in prov_recv()
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()
338 !bt_mesh_prov_link.role->op[type]) { in prov_recv()
340 bt_mesh_prov_link.role->error(PROV_ERR_UNEXP_PDU); in prov_recv()
351 if (buf->len != expected) { in prov_recv()
352 LOG_ERR("Invalid length %u for type 0x%02x", buf->len, type); 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()
364 if (bt_mesh_prov->link_open) { in prov_link_opened()
365 bt_mesh_prov->link_open(bearer->type); 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()
384 if (bt_mesh_prov->link_close) { in prov_link_closed()
385 bt_mesh_prov->link_close(bearer->type); 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()
411 if (bt_mesh_prov->complete) { in bt_mesh_prov_complete()
412 bt_mesh_prov->complete(net_idx, addr); in bt_mesh_prov_complete()
428 if (bt_mesh_prov->reset) { in bt_mesh_prov_reset()
429 bt_mesh_prov->reset(); in bt_mesh_prov_reset()
437 return -EINVAL; in bt_mesh_prov_init()