diff --git a/subsys/bluetooth/host/mesh/shell.c b/subsys/bluetooth/host/mesh/shell.c index 5f224474b8c..391b4c72fd0 100644 --- a/subsys/bluetooth/host/mesh/shell.c +++ b/subsys/bluetooth/host/mesh/shell.c @@ -660,6 +660,25 @@ static int cmd_net_send(int argc, char *argv[]) return 0; } +static int cmd_iv_update(int argc, char *argv[]) +{ + if (!bt_mesh_is_provisioned()) { + printk("Not yet provisioned!\n"); + return 0; + } + + if (bt_mesh.iv_update) { + printk("Transitioning to IV Update Normal state\n"); + bt_mesh_iv_update(bt_mesh.iv_index, false); + } else { + printk("Transitioning to IV Update In Progress state\n"); + bt_mesh_iv_update(bt_mesh.iv_index + 1, true); + printk("New IV Index 0x%08x\n", bt_mesh.iv_index); + } + + return 0; +} + static int cmd_beacon(int argc, char *argv[]) { u8_t status; @@ -1760,7 +1779,9 @@ static const struct shell_cmd mesh_commands[] = { { "netidx", cmd_netidx, "[NetIdx]" }, { "appidx", cmd_appidx, "[AppIdx]" }, + /* Commands which access internal APIs, for testing only */ { "net-send", cmd_net_send, "" }, + { "iv-update", cmd_iv_update, NULL }, /* Configuration Client Model operations */ { "get-comp", cmd_get_comp, "[page]" },