Skip to content

Commit 88644a7

Browse files
Thalleycarlescufi
authored andcommitted
Bluetooth: Audio: Shell: Add unicast client operation callbacks
Add the unicast client operation callbacks to the shell, simply printing the values sent by the server. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 68fa047 commit 88644a7

File tree

1 file changed

+64
-0
lines changed
  • subsys/bluetooth/shell

1 file changed

+64
-0
lines changed

subsys/bluetooth/shell/bap.c

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,9 +840,73 @@ static void available_contexts_cb(struct bt_conn *conn,
840840
shell_print(ctx_shell, "snk ctx %u src ctx %u\n", snk_ctx, src_ctx);
841841
}
842842

843+
static void config_cb(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
844+
enum bt_bap_ascs_reason reason)
845+
{
846+
shell_print(ctx_shell, "stream %p config operation rsp_code %u reason %u",
847+
stream, rsp_code, reason);
848+
}
849+
850+
static void qos_cb(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
851+
enum bt_bap_ascs_reason reason)
852+
{
853+
shell_print(ctx_shell, "stream %p qos operation rsp_code %u reason %u",
854+
stream, rsp_code, reason);
855+
}
856+
857+
static void enable_cb(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
858+
enum bt_bap_ascs_reason reason)
859+
{
860+
shell_print(ctx_shell, "stream %p enable operation rsp_code %u reason %u",
861+
stream, rsp_code, reason);
862+
}
863+
864+
static void start_cb(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
865+
enum bt_bap_ascs_reason reason)
866+
{
867+
shell_print(ctx_shell, "stream %p start operation rsp_code %u reason %u",
868+
stream, rsp_code, reason);
869+
}
870+
871+
static void stop_cb(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
872+
enum bt_bap_ascs_reason reason)
873+
{
874+
shell_print(ctx_shell, "stream %p stop operation rsp_code %u reason %u",
875+
stream, rsp_code, reason);
876+
}
877+
878+
static void disable_cb(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
879+
enum bt_bap_ascs_reason reason)
880+
{
881+
shell_print(ctx_shell, "stream %p disable operation rsp_code %u reason %u",
882+
stream, rsp_code, reason);
883+
}
884+
885+
static void metadata_cb(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
886+
enum bt_bap_ascs_reason reason)
887+
{
888+
shell_print(ctx_shell, "stream %p metadata operation rsp_code %u reason %u",
889+
stream, rsp_code, reason);
890+
}
891+
892+
static void release_cb(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
893+
enum bt_bap_ascs_reason reason)
894+
{
895+
shell_print(ctx_shell, "stream %p release operation rsp_code %u reason %u",
896+
stream, rsp_code, reason);
897+
}
898+
843899
const struct bt_bap_unicast_client_cb unicast_client_cbs = {
844900
.location = unicast_client_location_cb,
845901
.available_contexts = available_contexts_cb,
902+
.config = config_cb,
903+
.qos = qos_cb,
904+
.enable = enable_cb,
905+
.start = start_cb,
906+
.stop = stop_cb,
907+
.disable = disable_cb,
908+
.metadata = metadata_cb,
909+
.release = release_cb,
846910
};
847911

848912
static int cmd_discover(const struct shell *sh, size_t argc, char *argv[])

0 commit comments

Comments
 (0)