Skip to content

Commit

Permalink
Bluetooth: BAP: Shell: Improve printing of the BASE
Browse files Browse the repository at this point in the history
Add offsets for each layer in the BASE and add printing
of the presentation delay.

Signed-off-by: Emil Gydesen <[email protected]>
  • Loading branch information
Thalley authored and carlescufi committed Jun 29, 2023
1 parent 7b94d57 commit a32ba62
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions subsys/bluetooth/audio/shell/bap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1566,33 +1566,31 @@ static void base_recv(struct bt_bap_broadcast_sink *sink, const struct bt_bap_ba
}

shell_print(ctx_shell, "Received BASE from sink %p:", sink);
shell_print(ctx_shell, "Presentation delay: %u", base->pd);

for (int i = 0; i < base->subgroup_count; i++) {
const struct bt_bap_base_subgroup *subgroup;

subgroup = &base->subgroups[i];

shell_print(ctx_shell, "Subgroup[%d]:", i);
shell_print(ctx_shell, "%2sSubgroup[%d]:", "", i);
print_codec(ctx_shell, &subgroup->codec);

for (int j = 0; j < subgroup->bis_count; j++) {
const struct bt_bap_base_bis_data *bis_data;

bis_data = &subgroup->bis_data[j];

shell_print(ctx_shell, "BIS[%d] index 0x%02x",
i, bis_data->index);
shell_print(ctx_shell, "%4sBIS[%d] index 0x%02x", "", i, bis_data->index);
bis_indexes[index_count++] = bis_data->index;

for (int k = 0; k < bis_data->data_count; k++) {
const struct bt_codec_data *codec_data;

codec_data = &bis_data->data[k];

shell_print(ctx_shell,
"data #%u: type 0x%02x len %u",
i, codec_data->data.type,
codec_data->data.data_len);
shell_print(ctx_shell, "%6sdata #%u: type 0x%02x len %u", "", i,
codec_data->data.type, codec_data->data.data_len);
shell_hexdump(ctx_shell, codec_data->data.data,
codec_data->data.data_len -
sizeof(codec_data->data.type));
Expand Down

0 comments on commit a32ba62

Please sign in to comment.