Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions subsys/bluetooth/host/classic/shell/a2dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ static void stream_suspended(struct bt_a2dp_stream *stream)
bt_shell_print("stream suspended");
}

#if defined(CONFIG_BT_A2DP_SINK)
static void sink_sbc_streamer_data(struct bt_a2dp_stream *stream, struct net_buf *buf,
uint16_t seq_num, uint32_t ts)
{
Expand All @@ -454,6 +455,17 @@ static void stream_recv(struct bt_a2dp_stream *stream,
sink_sbc_streamer_data(stream, buf, seq_num, ts);
}

static void app_delay_report_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
{
if (rsp_err_code == 0) {
bt_shell_print("success to send report delay");
} else {
bt_shell_print("fail to send report delay");
}
}
#endif

#if defined(CONFIG_BT_A2DP_SOURCE)
static int app_delay_report_req(struct bt_a2dp_stream *stream, uint16_t value,
uint8_t *rsp_err_code)
{
Expand All @@ -462,14 +474,11 @@ static int app_delay_report_req(struct bt_a2dp_stream *stream, uint16_t value,
return 0;
}

static void app_delay_report_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
static void delay_report(struct bt_a2dp_stream *stream, uint16_t value)
{
if (rsp_err_code == 0) {
bt_shell_print("success to send report delay");
} else {
bt_shell_print("fail to send report delay");
}
bt_shell_print("received delay report: %d 1/10ms", value);
}
#endif

static int app_get_config_req(struct bt_a2dp_stream *stream, uint8_t *rsp_err_code)
{
Expand Down Expand Up @@ -621,11 +630,6 @@ static int cmd_disconnect(const struct shell *sh, int32_t argc, char *argv[])
return 0;
}

static void delay_report(struct bt_a2dp_stream *stream, uint16_t value)
{
bt_shell_print("received delay report: %d 1/10ms", value);
}

static struct bt_a2dp_stream_ops stream_ops = {
.configured = stream_configured,
.established = stream_established,
Expand Down Expand Up @@ -838,6 +842,7 @@ static int cmd_send_media(const struct shell *sh, int32_t argc, char *argv[])
return 0;
}

#if defined(CONFIG_BT_A2DP_SINK)
static int cmd_send_delay_report(const struct shell *sh, int32_t argc, char *argv[])
{
int err;
Expand All @@ -854,6 +859,7 @@ static int cmd_send_delay_report(const struct shell *sh, int32_t argc, char *arg

return 0;
}
#endif

static int cmd_get_config(const struct shell *sh, int32_t argc, char *argv[])
{
Expand Down Expand Up @@ -886,7 +892,9 @@ SHELL_STATIC_SUBCMD_SET_CREATE(a2dp_cmds,
SHELL_CMD_ARG(suspend, NULL, "\"suspend the stream\"", cmd_suspend, 1, 0),
SHELL_CMD_ARG(abort, NULL, "\"abort the stream\"", cmd_abort, 1, 0),
SHELL_CMD_ARG(send_media, NULL, HELP_NONE, cmd_send_media, 1, 0),
#if defined(CONFIG_BT_A2DP_SINK)
SHELL_CMD_ARG(send_delay_report, NULL, HELP_NONE, cmd_send_delay_report, 1, 0),
#endif
SHELL_CMD_ARG(get_config, NULL, HELP_NONE, cmd_get_config, 1, 0),
SHELL_SUBCMD_SET_END
);
Expand Down