Bluetooth: shell: Add id-delete command
Add a command to test the new bt_id_delete() API. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
346f815d9e
commit
61ec51251e
1 changed files with 24 additions and 0 deletions
|
@ -671,6 +671,29 @@ static int cmd_id_reset(int argc, char *argv[])
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cmd_id_delete(int argc, char *argv[])
|
||||
{
|
||||
u8_t id;
|
||||
int err;
|
||||
|
||||
if (argc < 2) {
|
||||
printk("Identity identifier not specified\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
id = strtol(argv[1], NULL, 10);
|
||||
|
||||
err = bt_id_delete(id);
|
||||
if (err < 0) {
|
||||
printk("Deleting ID %u failed (err %d)\n", id, err);
|
||||
return 0;
|
||||
}
|
||||
|
||||
printk("Identity %u deleted\n", id);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cmd_id_show(int argc, char *argv[])
|
||||
{
|
||||
bt_addr_le_t addrs[CONFIG_BT_ID_MAX];
|
||||
|
@ -2138,6 +2161,7 @@ static const struct shell_cmd bt_commands[] = {
|
|||
#endif
|
||||
{ "id-create", cmd_id_create, "[addr]" },
|
||||
{ "id-reset", cmd_id_reset, "<id> [addr]" },
|
||||
{ "id-delete", cmd_id_delete, "<id>" },
|
||||
{ "id-show", cmd_id_show, HELP_NONE },
|
||||
{ "id-select", cmd_id_select, "<id>" },
|
||||
{ "name", cmd_name, "[name]" },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue