Skip to content

Commit 7712f81

Browse files
Thalleynashif
authored andcommitted
Bluetooth: CAP: Shell: Add cmd_cap_initiator_unicast_cancel
Add cmd_cap_initiator_unicast_cancel to call the cancel function. Signed-off-by: Emil Gydesen <[email protected]>
1 parent e9c1be8 commit 7712f81

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

subsys/bluetooth/audio/shell/cap_initiator.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,19 @@ static int cmd_cap_initiator_unicast_stop(const struct shell *sh, size_t argc,
469469
return err;
470470
}
471471

472+
static int cmd_cap_initiator_unicast_cancel(const struct shell *sh, size_t argc, char *argv[])
473+
{
474+
int err = 0;
475+
476+
err = bt_cap_initiator_unicast_audio_cancel();
477+
if (err != 0) {
478+
shell_print(sh, "Failed to cancel unicast audio procedure: %d", err);
479+
480+
return -ENOEXEC;
481+
}
482+
483+
return 0;
484+
}
472485
#endif /* CONFIG_BT_BAP_UNICAST_CLIENT */
473486

474487
static int cmd_cap_initiator(const struct shell *sh, size_t argc, char **argv)
@@ -499,6 +512,8 @@ SHELL_STATIC_SUBCMD_SET_CREATE(cap_initiator_cmds,
499512
CAP_UNICAST_CLIENT_STREAM_COUNT),
500513
SHELL_CMD_ARG(unicast-stop, NULL, "Unicast stop all streams",
501514
cmd_cap_initiator_unicast_stop, 1, 0),
515+
SHELL_CMD_ARG(unicast-cancel, NULL, "Unicast cancel current procedure",
516+
cmd_cap_initiator_unicast_cancel, 1, 0),
502517
#endif /* CONFIG_BT_BAP_UNICAST_CLIENT */
503518
SHELL_SUBCMD_SET_END
504519
);

0 commit comments

Comments
 (0)