bluetooth: shell: Fix stream_start_sine for single stream

Fixed the stream_start_sine function when omitting the all argument.
The verification of the sine checked reversed return value, and was
placed in incorrect order.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
This commit is contained in:
Fredrik Danebjer 2023-12-14 09:00:00 +01:00 committed by Fabio Baltieri
commit 37e1a116ef

View file

@ -2697,11 +2697,6 @@ static int cmd_start_sine(const struct shell *sh, size_t argc, char *argv[])
shell_print(sh, "Started transmitting on broadcast stream %p", bap_stream);
}
} else {
if (stream_start_sine_verify(default_stream)) {
shell_error(sh, "Invalid stream %p", default_stream);
return -ENOEXEC;
}
err = init_lc3(default_stream);
if (err != 0) {
shell_error(sh, "Failed to init LC3 %d", err);
@ -2709,6 +2704,11 @@ static int cmd_start_sine(const struct shell *sh, size_t argc, char *argv[])
return -ENOEXEC;
}
if (!stream_start_sine_verify(default_stream)) {
shell_error(sh, "Invalid stream %p", default_stream);
return -ENOEXEC;
}
err = stream_start_sine(default_stream);
if (err != 0) {
shell_error(sh, "Failed to start TX for stream %p: %d", default_stream,