Bluetooth: Mesh: shell: Add iv-update command
This command is needed to pass some IV Update-related PTS tests. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
6e2a3863ac
commit
a41449ef2a
1 changed files with 21 additions and 0 deletions
|
@ -660,6 +660,25 @@ static int cmd_net_send(int argc, char *argv[])
|
||||||
return 0;
|
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[])
|
static int cmd_beacon(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
u8_t status;
|
u8_t status;
|
||||||
|
@ -1760,7 +1779,9 @@ static const struct shell_cmd mesh_commands[] = {
|
||||||
{ "netidx", cmd_netidx, "[NetIdx]" },
|
{ "netidx", cmd_netidx, "[NetIdx]" },
|
||||||
{ "appidx", cmd_appidx, "[AppIdx]" },
|
{ "appidx", cmd_appidx, "[AppIdx]" },
|
||||||
|
|
||||||
|
/* Commands which access internal APIs, for testing only */
|
||||||
{ "net-send", cmd_net_send, "<hex string>" },
|
{ "net-send", cmd_net_send, "<hex string>" },
|
||||||
|
{ "iv-update", cmd_iv_update, NULL },
|
||||||
|
|
||||||
/* Configuration Client Model operations */
|
/* Configuration Client Model operations */
|
||||||
{ "get-comp", cmd_get_comp, "[page]" },
|
{ "get-comp", cmd_get_comp, "[page]" },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue