Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions subsys/bluetooth/mesh/dk_prov.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <dk_buttons_and_leds.h>
#include <zephyr/drivers/hwinfo.h>
#include <zephyr/logging/log.h>
#include <zephyr/sys/byteorder.h>

LOG_MODULE_REGISTER(dk_bt_mesh_prov, CONFIG_BT_MESH_DK_PROV_LOG_LEVEL);

Expand Down Expand Up @@ -45,7 +46,7 @@ static void oob_button_timeout(void)
dk_button_handler_remove(&button_handler);
dk_set_leds(DK_NO_LEDS_MSK);

bt_mesh_input_number(button_press_count);
bt_mesh_input_numeric((uint8_t *)&button_press_count, sizeof(button_press_count));
oob_state = OOB_IDLE;
}

Expand All @@ -64,8 +65,17 @@ static void oob_timer_handler(struct k_work *work)
}
}

static int output_number(bt_mesh_output_action_t action, uint32_t number)
static int output_numeric(bt_mesh_output_action_t action, uint8_t *numeric, size_t size)
{
uint32_t number = 0;

if (size > sizeof(number)) {
printk("Wrong OOB size: %u\n", size);
return -EINVAL;
}

sys_get_le(&number, numeric, size);

if (IS_ENABLED(CONFIG_BT_MESH_DK_PROV_OOB_LOG) &&
action == BT_MESH_DISPLAY_NUMBER) {
printk("OOB Number: %u\n", number);
Expand Down Expand Up @@ -162,7 +172,7 @@ static const struct bt_mesh_prov prov = {
| BT_MESH_BLINK
#endif
),
.output_number = output_number,
.output_numeric = output_numeric,
.output_string = output_string,
.input = input,
#ifdef CONFIG_BT_MESH_DK_PROV_OOB_BUTTON
Expand Down
12 changes: 10 additions & 2 deletions tests/bluetooth/tester/src/mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,17 @@ static void link_close(bt_mesh_prov_bearer_t bearer)
CONTROLLER_INDEX, (uint8_t *) &ev, sizeof(ev));
}

static int output_number(bt_mesh_output_action_t action, uint32_t number)
static int output_numeric(bt_mesh_output_action_t action, uint8_t *numeric, size_t size)
{
struct mesh_out_number_action_ev ev;
uint32_t number;

if (size > sizeof(number)) {
LOG_ERR("Unsupported size %zu", size);
return -EINVAL;
}

number = sys_get_le32(numeric);

LOG_DBG("action 0x%04x number 0x%08x", action, number);

Expand Down Expand Up @@ -196,7 +204,7 @@ static struct bt_mesh_prov prov = {
.uuid = dev_uuid,
.static_val = static_auth,
.static_val_len = sizeof(static_auth),
.output_number = output_number,
.output_numeric = output_numeric,
.output_string = output_string,
.input = input,
.link_open = link_open,
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ manifest:
# https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html
- name: zephyr
repo-path: sdk-zephyr
revision: de567402f0883a5c237a7478ca6451f0e5c681b3
revision: 64201a31d0b6d7a46c9f6462743c6529551c9fcb
import:
# In addition to the zephyr repository itself, NCS also
# imports the contents of zephyr/west.yml at the above
Expand Down