From 06bb9f258a0a5921b9c16ad8291c9be9a80a6881 Mon Sep 17 00:00:00 2001 From: Jens Rehhoff Thomsen Date: Fri, 31 May 2024 11:09:27 +0200 Subject: [PATCH] Bluetooth: BAP: Shell: Add endpoint state info The bap list command now also shows the states of each endpoint. Fixes #70838 Signed-off-by: Jens Rehhoff Thomsen --- subsys/bluetooth/audio/shell/bap.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/audio/shell/bap.c b/subsys/bluetooth/audio/shell/bap.c index b560ba3c714..e63b2d559d1 100644 --- a/subsys/bluetooth/audio/shell/bap.c +++ b/subsys/bluetooth/audio/shell/bap.c @@ -1649,7 +1649,13 @@ static void conn_list_eps(struct bt_conn *conn, void *data) const struct bt_bap_ep *ep = snks[conn_index][i]; if (ep != NULL) { - shell_print(sh, " #%u: ep %p", i, ep); + struct bt_bap_ep_info ep_info; + int err; + + err = bt_bap_ep_get_info(ep, &ep_info); + if (err == 0) { + shell_print(sh, " #%u: ep %p (state: %d)", i, ep, ep_info.state); + } } } #endif /* CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT > 0 */ @@ -1661,7 +1667,13 @@ static void conn_list_eps(struct bt_conn *conn, void *data) const struct bt_bap_ep *ep = srcs[conn_index][i]; if (ep != NULL) { - shell_print(sh, " #%u: ep %p", i, ep); + struct bt_bap_ep_info ep_info; + int err; + + err = bt_bap_ep_get_info(ep, &ep_info); + if (err == 0) { + shell_print(sh, " #%u: ep %p (state: %d)", i, ep, ep_info.state); + } } } #endif /* CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT > 0 */