From ebadb11645bd3e65df08b0ed5d3ce83250dea440 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Mon, 20 May 2024 19:40:04 +0200 Subject: [PATCH] Bluetooth: Audio: Spring cleaning Adds, removes and modifies includes in all LE audio files. Fixes any found spelling mistakes as well. Fixes a few places where incorrect types were used. Signed-off-by: Emil Gydesen --- include/zephyr/bluetooth/audio/aics.h | 3 + include/zephyr/bluetooth/audio/audio.h | 19 ++++-- include/zephyr/bluetooth/audio/bap.h | 12 +++- .../zephyr/bluetooth/audio/bap_lc3_preset.h | 1 + include/zephyr/bluetooth/audio/cap.h | 10 ++- include/zephyr/bluetooth/audio/csip.h | 9 +++ .../zephyr/bluetooth/audio/gmap_lc3_preset.h | 2 + include/zephyr/bluetooth/audio/has.h | 6 +- include/zephyr/bluetooth/audio/mcc.h | 3 +- include/zephyr/bluetooth/audio/mcs.h | 1 + include/zephyr/bluetooth/audio/media_proxy.h | 1 + include/zephyr/bluetooth/audio/micp.h | 2 + include/zephyr/bluetooth/audio/pacs.h | 4 ++ include/zephyr/bluetooth/audio/pbp.h | 6 +- include/zephyr/bluetooth/audio/tbs.h | 1 + include/zephyr/bluetooth/audio/tmap.h | 2 + include/zephyr/bluetooth/audio/vcp.h | 2 + subsys/bluetooth/audio/aics.c | 24 +++++-- subsys/bluetooth/audio/aics_client.c | 27 +++++--- subsys/bluetooth/audio/aics_internal.h | 9 ++- subsys/bluetooth/audio/ascs.c | 37 +++++++---- subsys/bluetooth/audio/ascs_internal.h | 9 +++ subsys/bluetooth/audio/audio.c | 16 ++++- subsys/bluetooth/audio/audio_internal.h | 7 +- subsys/bluetooth/audio/bap_base.c | 15 ++++- .../bluetooth/audio/bap_broadcast_assistant.c | 28 ++++++-- subsys/bluetooth/audio/bap_broadcast_sink.c | 30 +++++++-- subsys/bluetooth/audio/bap_broadcast_source.c | 23 +++++-- subsys/bluetooth/audio/bap_endpoint.h | 9 +++ subsys/bluetooth/audio/bap_internal.h | 9 ++- subsys/bluetooth/audio/bap_iso.c | 17 ++++- subsys/bluetooth/audio/bap_iso.h | 7 +- subsys/bluetooth/audio/bap_scan_delegator.c | 35 +++++++--- subsys/bluetooth/audio/bap_stream.c | 23 +++++-- subsys/bluetooth/audio/bap_stream.h | 8 +++ subsys/bluetooth/audio/bap_unicast_client.c | 45 +++++++------ .../audio/bap_unicast_client_internal.h | 8 +++ subsys/bluetooth/audio/bap_unicast_server.c | 21 ++++-- subsys/bluetooth/audio/bap_unicast_server.h | 3 + subsys/bluetooth/audio/cap_acceptor.c | 15 ++++- subsys/bluetooth/audio/cap_commander.c | 26 ++++++-- subsys/bluetooth/audio/cap_initiator.c | 4 +- subsys/bluetooth/audio/cap_internal.h | 12 ++-- subsys/bluetooth/audio/cap_stream.c | 5 +- subsys/bluetooth/audio/ccid.c | 5 ++ subsys/bluetooth/audio/ccid_internal.h | 4 +- subsys/bluetooth/audio/codec.c | 12 +++- subsys/bluetooth/audio/csip_crypto.c | 11 +++- subsys/bluetooth/audio/csip_crypto.h | 4 +- subsys/bluetooth/audio/csip_internal.h | 5 +- subsys/bluetooth/audio/csip_set_coordinator.c | 36 +++++++---- subsys/bluetooth/audio/csip_set_member.c | 40 ++++++++---- subsys/bluetooth/audio/gmap_client.c | 14 +++- subsys/bluetooth/audio/gmap_server.c | 16 ++++- subsys/bluetooth/audio/has.c | 36 ++++++++--- subsys/bluetooth/audio/has_client.c | 21 ++++-- subsys/bluetooth/audio/has_internal.h | 6 ++ subsys/bluetooth/audio/mcc.c | 41 +++++++----- subsys/bluetooth/audio/mcc_internal.h | 9 ++- subsys/bluetooth/audio/mcs.c | 34 ++++++---- subsys/bluetooth/audio/mcs_internal.h | 5 +- subsys/bluetooth/audio/media_proxy.c | 13 ++-- subsys/bluetooth/audio/media_proxy_internal.h | 4 ++ subsys/bluetooth/audio/micp_internal.h | 6 +- subsys/bluetooth/audio/micp_mic_ctlr.c | 30 ++++++--- subsys/bluetooth/audio/micp_mic_dev.c | 25 +++++--- subsys/bluetooth/audio/mpl.c | 34 ++++++---- subsys/bluetooth/audio/mpl_internal.h | 7 ++ subsys/bluetooth/audio/pacs.c | 41 ++++++++---- subsys/bluetooth/audio/pacs_internal.h | 4 +- subsys/bluetooth/audio/pbp.c | 13 +++- subsys/bluetooth/audio/shell/audio.h | 18 +++++- subsys/bluetooth/audio/shell/bap.c | 42 +++++++++--- .../audio/shell/bap_broadcast_assistant.c | 28 +++++--- .../audio/shell/bap_scan_delegator.c | 30 ++++++--- subsys/bluetooth/audio/shell/bap_usb.c | 15 ++++- subsys/bluetooth/audio/shell/cap_acceptor.c | 16 ++++- subsys/bluetooth/audio/shell/cap_commander.c | 8 ++- subsys/bluetooth/audio/shell/cap_initiator.c | 19 +++++- .../audio/shell/csip_set_coordinator.c | 27 +++++--- .../bluetooth/audio/shell/csip_set_member.c | 22 +++++-- subsys/bluetooth/audio/shell/gmap.c | 13 +++- subsys/bluetooth/audio/shell/has.c | 15 +++-- subsys/bluetooth/audio/shell/has_client.c | 11 +++- subsys/bluetooth/audio/shell/mcc.c | 21 ++++-- .../bluetooth/audio/shell/media_controller.c | 26 +++++--- subsys/bluetooth/audio/shell/micp_mic_ctlr.c | 17 +++-- subsys/bluetooth/audio/shell/micp_mic_dev.c | 19 ++++-- subsys/bluetooth/audio/shell/mpl.c | 14 ++-- subsys/bluetooth/audio/shell/pbp.c | 16 ++++- subsys/bluetooth/audio/shell/tbs.c | 15 ++++- subsys/bluetooth/audio/shell/tbs_client.c | 18 ++++-- subsys/bluetooth/audio/shell/tmap.c | 5 ++ subsys/bluetooth/audio/shell/vcp_vol_ctlr.c | 15 ++++- subsys/bluetooth/audio/shell/vcp_vol_rend.c | 19 ++++-- subsys/bluetooth/audio/tbs.c | 25 ++++++-- subsys/bluetooth/audio/tbs_client.c | 33 ++++++---- subsys/bluetooth/audio/tbs_internal.h | 10 ++- subsys/bluetooth/audio/tmap.c | 26 +++++--- subsys/bluetooth/audio/vcp_internal.h | 8 +++ subsys/bluetooth/audio/vcp_vol_ctlr.c | 40 +++++++----- subsys/bluetooth/audio/vcp_vol_rend.c | 32 +++++++--- subsys/bluetooth/audio/vocs.c | 30 ++++++--- subsys/bluetooth/audio/vocs_client.c | 29 ++++++--- subsys/bluetooth/audio/vocs_internal.h | 10 ++- .../audio/src/bap_bass_broadcaster_test.c | 11 ++++ .../audio/src/bap_broadcast_assistant_test.c | 22 ++++++- .../audio/src/bap_broadcast_sink_test.c | 24 ++++++- .../audio/src/bap_broadcast_source_test.c | 22 ++++++- tests/bsim/bluetooth/audio/src/bap_common.c | 9 +++ tests/bsim/bluetooth/audio/src/bap_common.h | 5 +- .../audio/src/bap_scan_delegator_test.c | 22 ++++++- .../audio/src/bap_unicast_client_test.c | 27 +++++++- .../audio/src/bap_unicast_server_test.c | 27 ++++++-- .../bluetooth/audio/src/cap_acceptor_test.c | 30 +++++++-- .../bluetooth/audio/src/cap_commander_test.c | 23 +++++-- .../audio/src/cap_initiator_broadcast_test.c | 24 +++++-- .../audio/src/cap_initiator_unicast_test.c | 31 +++++++-- tests/bsim/bluetooth/audio/src/common.c | 23 ++++++- tests/bsim/bluetooth/audio/src/common.h | 22 ++++--- .../audio/src/csip_notify_client_test.c | 13 +++- .../audio/src/csip_notify_server_test.c | 12 ++++ .../audio/src/csip_set_coordinator_test.c | 21 +++++- .../audio/src/csip_set_member_test.c | 14 +++- .../bsim/bluetooth/audio/src/gmap_ugg_test.c | 27 +++++++- .../bsim/bluetooth/audio/src/gmap_ugt_test.c | 23 ++++++- .../bluetooth/audio/src/has_client_test.c | 16 ++++- tests/bsim/bluetooth/audio/src/has_test.c | 12 +++- .../bluetooth/audio/src/ias_client_test.c | 10 ++- tests/bsim/bluetooth/audio/src/ias_test.c | 10 +-- tests/bsim/bluetooth/audio/src/main.c | 2 + tests/bsim/bluetooth/audio/src/mcc_test.c | 20 ++++-- tests/bsim/bluetooth/audio/src/mcs_test.c | 8 ++- .../audio/src/media_controller_test.c | 16 +++-- .../bluetooth/audio/src/micp_mic_ctlr_test.c | 11 +++- .../bluetooth/audio/src/micp_mic_dev_test.c | 14 +++- .../audio/src/pacs_notify_client_test.c | 11 ++++ .../audio/src/pacs_notify_server_test.c | 19 +++++- .../src/pbp_public_broadcast_sink_test.c | 23 +++++-- .../src/pbp_public_broadcast_source_test.c | 23 +++++-- .../bluetooth/audio/src/tbs_client_test.c | 30 +++++---- tests/bsim/bluetooth/audio/src/tbs_test.c | 64 +++++++++++-------- .../bluetooth/audio/src/tmap_client_test.c | 23 ++++--- .../bluetooth/audio/src/tmap_server_test.c | 17 ++--- .../bluetooth/audio/src/vcp_vol_ctlr_test.c | 14 ++-- .../bluetooth/audio/src/vcp_vol_rend_test.c | 13 +++- 146 files changed, 1912 insertions(+), 600 deletions(-) diff --git a/include/zephyr/bluetooth/audio/aics.h b/include/zephyr/bluetooth/audio/aics.h index 55f2eab2f93..a554c150395 100644 --- a/include/zephyr/bluetooth/audio/aics.h +++ b/include/zephyr/bluetooth/audio/aics.h @@ -27,7 +27,10 @@ * autonomously read the change counter value when executing a write request. * */ +#include +#include +#include #include #ifdef __cplusplus diff --git a/include/zephyr/bluetooth/audio/audio.h b/include/zephyr/bluetooth/audio/audio.h index 0578f632bd2..5bc503f5a3d 100644 --- a/include/zephyr/bluetooth/audio/audio.h +++ b/include/zephyr/bluetooth/audio/audio.h @@ -18,14 +18,21 @@ * @{ */ -#include +#include +#include +#include + +#include +#include +#include #include #include +#include #include #include -#include -#include - +#include +#include +#include #ifdef __cplusplus extern "C" { @@ -1011,7 +1018,7 @@ int bt_audio_codec_cfg_set_chan_allocation(struct bt_audio_codec_cfg *codec_cfg, * * The overall SDU size will be octets_per_frame * blocks_per_sdu. * - * The Bluetooth specificationa are not clear about this value - it does not state that + * The Bluetooth specifications are not clear about this value - it does not state that * the codec shall use this SDU size only. A codec like LC3 supports variable bit-rate * (per SDU) hence it might be allowed for an encoder to reduce the frame size below this * value. @@ -1040,7 +1047,7 @@ int bt_audio_codec_cfg_get_octets_per_frame(const struct bt_audio_codec_cfg *cod int bt_audio_codec_cfg_set_octets_per_frame(struct bt_audio_codec_cfg *codec_cfg, uint16_t octets_per_frame); -/** @brief Extract number of audio frame blockss in each SDU from BT codec config +/** @brief Extract number of audio frame blocks in each SDU from BT codec config * * The overall SDU size will be octets_per_frame * frame_blocks_per_sdu * number-of-channels. * diff --git a/include/zephyr/bluetooth/audio/bap.h b/include/zephyr/bluetooth/audio/bap.h index 32d9840c5be..00957b2b81b 100644 --- a/include/zephyr/bluetooth/audio/bap.h +++ b/include/zephyr/bluetooth/audio/bap.h @@ -17,9 +17,17 @@ * @{ */ -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/bluetooth/audio/bap_lc3_preset.h b/include/zephyr/bluetooth/audio/bap_lc3_preset.h index d31c47fd4fb..7ba6af250a2 100644 --- a/include/zephyr/bluetooth/audio/bap_lc3_preset.h +++ b/include/zephyr/bluetooth/audio/bap_lc3_preset.h @@ -10,6 +10,7 @@ #define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_BAP_LC3_PRESET_ #include +#include /** Struct to hold a BAP defined LC3 preset */ struct bt_bap_lc3_preset { diff --git a/include/zephyr/bluetooth/audio/cap.h b/include/zephyr/bluetooth/audio/cap.h index c5c4bbea6e8..afc1ca9018e 100644 --- a/include/zephyr/bluetooth/audio/cap.h +++ b/include/zephyr/bluetooth/audio/cap.h @@ -19,12 +19,18 @@ * @{ */ +#include +#include #include -#include -#include #include #include +#include +#include +#include +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/bluetooth/audio/csip.h b/include/zephyr/bluetooth/audio/csip.h index 6f3a0280242..7b8d8d2631f 100644 --- a/include/zephyr/bluetooth/audio/csip.h +++ b/include/zephyr/bluetooth/audio/csip.h @@ -19,7 +19,16 @@ * @{ */ +#include +#include +#include + +#include +#include #include +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/bluetooth/audio/gmap_lc3_preset.h b/include/zephyr/bluetooth/audio/gmap_lc3_preset.h index e5a22936c74..5e50de243e7 100644 --- a/include/zephyr/bluetooth/audio/gmap_lc3_preset.h +++ b/include/zephyr/bluetooth/audio/gmap_lc3_preset.h @@ -9,7 +9,9 @@ #ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_GMAP_LC3_PRESET_ #define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_GMAP_LC3_PRESET_ +#include #include +#include /* GMAP LC3 unicast presets defined by table 3.16 in the GMAP v1.0 specification */ diff --git a/include/zephyr/bluetooth/audio/has.h b/include/zephyr/bluetooth/audio/has.h index 0e5c1652902..7bd20aec89e 100644 --- a/include/zephyr/bluetooth/audio/has.h +++ b/include/zephyr/bluetooth/audio/has.h @@ -22,10 +22,12 @@ * to control hearing aid presets. */ -#include +#include +#include #include #include +#include #ifdef __cplusplus extern "C" { @@ -63,7 +65,7 @@ enum bt_has_properties { BT_HAS_PROP_AVAILABLE = BIT(1), }; -/** Hearing Aid device capablilities */ +/** Hearing Aid device capabilities */ enum bt_has_capabilities { BT_HAS_PRESET_SUPPORT = BIT(0), }; diff --git a/include/zephyr/bluetooth/audio/mcc.h b/include/zephyr/bluetooth/audio/mcc.h index 14dba829225..fb71f011db9 100644 --- a/include/zephyr/bluetooth/audio/mcc.h +++ b/include/zephyr/bluetooth/audio/mcc.h @@ -22,6 +22,7 @@ #define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_MCC_ #include +#include #include #include @@ -407,7 +408,7 @@ typedef void (*bt_mcc_read_content_control_id_cb)(struct bt_conn *conn, typedef void (*bt_mcc_otc_obj_selected_cb)(struct bt_conn *conn, int err); /** - * @brief Callback function for bt_mcc_otc_read_object_meatadata() + * @brief Callback function for bt_mcc_otc_read_object_metadata() * * Called when object metadata is read * diff --git a/include/zephyr/bluetooth/audio/mcs.h b/include/zephyr/bluetooth/audio/mcs.h index 7d9491944ef..5212905497c 100644 --- a/include/zephyr/bluetooth/audio/mcs.h +++ b/include/zephyr/bluetooth/audio/mcs.h @@ -23,6 +23,7 @@ */ #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/bluetooth/audio/media_proxy.h b/include/zephyr/bluetooth/audio/media_proxy.h index 0e236a1fd4a..16bb978bfcc 100644 --- a/include/zephyr/bluetooth/audio/media_proxy.h +++ b/include/zephyr/bluetooth/audio/media_proxy.h @@ -40,6 +40,7 @@ #include #include +#include /* TODO: Remove dependency on mcs.h */ #include "mcs.h" diff --git a/include/zephyr/bluetooth/audio/micp.h b/include/zephyr/bluetooth/audio/micp.h index 500eb204839..0fe9a7af681 100644 --- a/include/zephyr/bluetooth/audio/micp.h +++ b/include/zephyr/bluetooth/audio/micp.h @@ -22,6 +22,8 @@ #include #include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/bluetooth/audio/pacs.h b/include/zephyr/bluetooth/audio/pacs.h index 6db4d34b0a2..74f401d7bd5 100644 --- a/include/zephyr/bluetooth/audio/pacs.h +++ b/include/zephyr/bluetooth/audio/pacs.h @@ -10,7 +10,11 @@ #ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_PACS_H_ #define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_PACS_H_ +#include + #include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/bluetooth/audio/pbp.h b/include/zephyr/bluetooth/audio/pbp.h index 71d7d107b4e..d218720895d 100644 --- a/include/zephyr/bluetooth/audio/pbp.h +++ b/include/zephyr/bluetooth/audio/pbp.h @@ -19,8 +19,12 @@ * @{ */ -#include #include +#include +#include +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/bluetooth/audio/tbs.h b/include/zephyr/bluetooth/audio/tbs.h index 523efc4264f..49039a7ff61 100644 --- a/include/zephyr/bluetooth/audio/tbs.h +++ b/include/zephyr/bluetooth/audio/tbs.h @@ -14,6 +14,7 @@ #include #include +#include /* Call States */ #define BT_TBS_CALL_STATE_INCOMING 0x00 diff --git a/include/zephyr/bluetooth/audio/tmap.h b/include/zephyr/bluetooth/audio/tmap.h index 4bcdbb0a5bf..1c8e8ccb892 100644 --- a/include/zephyr/bluetooth/audio/tmap.h +++ b/include/zephyr/bluetooth/audio/tmap.h @@ -9,8 +9,10 @@ #ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_TMAP_ #define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_TMAP_ +#include #include #include +#include /** Call Gateway (CG) supported */ #define BT_TMAP_CG_SUPPORTED \ diff --git a/include/zephyr/bluetooth/audio/vcp.h b/include/zephyr/bluetooth/audio/vcp.h index 1128bf18d1e..755ee12d065 100644 --- a/include/zephyr/bluetooth/audio/vcp.h +++ b/include/zephyr/bluetooth/audio/vcp.h @@ -23,6 +23,8 @@ #include #include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/subsys/bluetooth/audio/aics.c b/subsys/bluetooth/audio/aics.c index 1e42cc73da5..222969aba24 100644 --- a/subsys/bluetooth/audio/aics.c +++ b/subsys/bluetooth/audio/aics.c @@ -5,17 +5,29 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include -#include - -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "aics_internal.h" #include "audio_internal.h" diff --git a/subsys/bluetooth/audio/aics_client.c b/subsys/bluetooth/audio/aics_client.c index 943f6475a38..332f5a7fabf 100644 --- a/subsys/bluetooth/audio/aics_client.c +++ b/subsys/bluetooth/audio/aics_client.c @@ -7,24 +7,31 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include - -#include - -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "aics_internal.h" -#include - LOG_MODULE_REGISTER(bt_aics_client, CONFIG_BT_AICS_CLIENT_LOG_LEVEL); static struct bt_aics aics_insts[CONFIG_BT_MAX_CONN * CONFIG_BT_AICS_CLIENT_MAX_INSTANCE_COUNT]; diff --git a/subsys/bluetooth/audio/aics_internal.h b/subsys/bluetooth/audio/aics_internal.h index 3c10287a0f3..4283abce2fb 100644 --- a/subsys/bluetooth/audio/aics_internal.h +++ b/subsys/bluetooth/audio/aics_internal.h @@ -11,8 +11,15 @@ #ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_AICS_INTERNAL_ #define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_AICS_INTERNAL_ -#include +#include +#include + +#include +#include #include +#include +#include +#include #if defined(CONFIG_BT_AICS) #define BT_AICS_MAX_DESC_SIZE CONFIG_BT_AICS_MAX_INPUT_DESCRIPTION_SIZE diff --git a/subsys/bluetooth/audio/ascs.c b/subsys/bluetooth/audio/ascs.c index 31e7bcca133..2528cc00b13 100644 --- a/subsys/bluetooth/audio/ascs.c +++ b/subsys/bluetooth/audio/ascs.c @@ -7,20 +7,33 @@ * * SPDX-License-Identifier: Apache-2.0 */ +#include +#include +#include +#include +#include +#include -#include -#include -#include - -#include -#include -#include -#include +#include +#include #include #include #include - +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include LOG_MODULE_REGISTER(bt_ascs, CONFIG_BT_ASCS_LOG_LEVEL); @@ -29,9 +42,11 @@ LOG_MODULE_REGISTER(bt_ascs, CONFIG_BT_ASCS_LOG_LEVEL); #include "../host/att_internal.h" +#include "ascs_internal.h" #include "audio_internal.h" -#include "bap_iso.h" #include "bap_endpoint.h" +#include "bap_iso.h" +#include "bap_stream.h" #include "bap_unicast_server.h" #include "pacs_internal.h" #include "cap_internal.h" @@ -1680,7 +1695,7 @@ int bt_ascs_config_ase(struct bt_conn *conn, struct bt_bap_stream *stream, return -EALREADY; } - /* Get a free ASE or NULL if all ASE instances are aready in use */ + /* Get a free ASE or NULL if all ASE instances are already in use */ for (int i = 1; i <= ASE_COUNT; i++) { if (ase_find(conn, i) == NULL) { ase = ase_new(conn, i); diff --git a/subsys/bluetooth/audio/ascs_internal.h b/subsys/bluetooth/audio/ascs_internal.h index fc76964a018..f96a1905ec5 100644 --- a/subsys/bluetooth/audio/ascs_internal.h +++ b/subsys/bluetooth/audio/ascs_internal.h @@ -7,6 +7,13 @@ * SPDX-License-Identifier: Apache-2.0 */ +#ifndef BT_ASCS_INTERNAL_H +#define BT_ASCS_INTERNAL_H + +#include +#include +#include + #define BT_ASCS_ASE_ID_NONE 0x00 /* The number of ASEs in the notification when the opcode is unsupported or the length of the @@ -349,3 +356,5 @@ int bt_ascs_disable_ase(struct bt_bap_ep *ep); int bt_ascs_release_ase(struct bt_bap_ep *ep); void bt_ascs_foreach_ep(struct bt_conn *conn, bt_bap_ep_func_t func, void *user_data); + +#endif /* BT_ASCS_INTERNAL_H */ diff --git a/subsys/bluetooth/audio/audio.c b/subsys/bluetooth/audio/audio.c index 619f52c7abc..f38ec14c001 100644 --- a/subsys/bluetooth/audio/audio.c +++ b/subsys/bluetooth/audio/audio.c @@ -6,11 +6,21 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include -#include +#include +#include +#include +#include +#include + +#include #include #include +#include +#include +#include +#include +#include +#include #include #include diff --git a/subsys/bluetooth/audio/audio_internal.h b/subsys/bluetooth/audio/audio_internal.h index f13e130089a..b6fde6118f4 100644 --- a/subsys/bluetooth/audio/audio_internal.h +++ b/subsys/bluetooth/audio/audio_internal.h @@ -5,9 +5,14 @@ * * SPDX-License-Identifier: Apache-2.0 */ +#include +#include +#include -#include +#include #include +#include +#include #define BT_AUDIO_NOTIFY_RETRY_DELAY_US ((CONFIG_BT_AUDIO_NOTIFY_RETRY_DELAY) * 1250U) diff --git a/subsys/bluetooth/audio/bap_base.c b/subsys/bluetooth/audio/bap_base.c index 9d8c2de3933..a649f744659 100644 --- a/subsys/bluetooth/audio/bap_base.c +++ b/subsys/bluetooth/audio/bap_base.c @@ -6,11 +6,24 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include #include #include -#include #include +#include #include +#include +#include LOG_MODULE_REGISTER(bt_bap_base, CONFIG_BT_BAP_BASE_LOG_LEVEL); diff --git a/subsys/bluetooth/audio/bap_broadcast_assistant.c b/subsys/bluetooth/audio/bap_broadcast_assistant.c index 90402d2db96..54b5bdd60d6 100644 --- a/subsys/bluetooth/audio/bap_broadcast_assistant.c +++ b/subsys/bluetooth/audio/bap_broadcast_assistant.c @@ -8,20 +8,36 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include - -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include #include #include +#include #include #include +#include +#include +#include +#include +#include +#include +#include #include #include +#include +#include +#include #include @@ -81,7 +97,7 @@ NET_BUF_SIMPLE_DEFINE_STATIC(att_buf, ATT_BUF_SIZE); static int16_t lookup_index_by_handle(uint16_t handle) { - for (int i = 0; i < ARRAY_SIZE(broadcast_assistant.recv_state_handles); i++) { + for (size_t i = 0U; i < ARRAY_SIZE(broadcast_assistant.recv_state_handles); i++) { if (broadcast_assistant.recv_state_handles[i] == handle) { return i; } diff --git a/subsys/bluetooth/audio/bap_broadcast_sink.c b/subsys/bluetooth/audio/bap_broadcast_sink.c index 97a1206b13a..52a4f8da343 100644 --- a/subsys/bluetooth/audio/bap_broadcast_sink.c +++ b/subsys/bluetooth/audio/bap_broadcast_sink.c @@ -6,27 +6,43 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include #include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "../host/conn_internal.h" #include "../host/iso_internal.h" +#include "audio_internal.h" #include "bap_iso.h" #include "bap_endpoint.h" -#include "audio_internal.h" - -#include LOG_MODULE_REGISTER(bt_bap_broadcast_sink, CONFIG_BT_BAP_BROADCAST_SINK_LOG_LEVEL); diff --git a/subsys/bluetooth/audio/bap_broadcast_source.c b/subsys/bluetooth/audio/bap_broadcast_source.c index 0934fc0f8d0..01e32ae9905 100644 --- a/subsys/bluetooth/audio/bap_broadcast_source.c +++ b/subsys/bluetooth/audio/bap_broadcast_source.c @@ -6,21 +6,36 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include +#include #include #include #include - +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include + LOG_MODULE_REGISTER(bt_bap_broadcast_source, CONFIG_BT_BAP_BROADCAST_SOURCE_LOG_LEVEL); #include "bap_iso.h" #include "bap_endpoint.h" +#include "bap_stream.h" struct bt_bap_broadcast_subgroup { /* The streams used to create the broadcast source */ diff --git a/subsys/bluetooth/audio/bap_endpoint.h b/subsys/bluetooth/audio/bap_endpoint.h index 12b1209fb09..4efea0dba67 100644 --- a/subsys/bluetooth/audio/bap_endpoint.h +++ b/subsys/bluetooth/audio/bap_endpoint.h @@ -7,8 +7,17 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include +#include + +#include +#include #include +#include +#include #include +#include +#include #include #include "ascs_internal.h" diff --git a/subsys/bluetooth/audio/bap_internal.h b/subsys/bluetooth/audio/bap_internal.h index 27f62977a22..905e862c9a2 100644 --- a/subsys/bluetooth/audio/bap_internal.h +++ b/subsys/bluetooth/audio/bap_internal.h @@ -9,10 +9,15 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include +#include +#include + #include #include +#include +#include +#include +#include #define BT_BAP_BASS_SCAN_STATE_NOT_SCANNING 0x00 #define BT_BAP_BASS_SCAN_STATE_SCANNING 0x01 diff --git a/subsys/bluetooth/audio/bap_iso.c b/subsys/bluetooth/audio/bap_iso.c index 3fa2059ea94..1104fbfb8da 100644 --- a/subsys/bluetooth/audio/bap_iso.c +++ b/subsys/bluetooth/audio/bap_iso.c @@ -7,12 +7,25 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "bap_iso.h" #include "audio_internal.h" #include "bap_endpoint.h" -#include - LOG_MODULE_REGISTER(bt_bap_iso, CONFIG_BT_BAP_ISO_LOG_LEVEL); /* TODO: Optimize the ISO_POOL_SIZE */ diff --git a/subsys/bluetooth/audio/bap_iso.h b/subsys/bluetooth/audio/bap_iso.h index 4384182d697..f1ebd0eed9b 100644 --- a/subsys/bluetooth/audio/bap_iso.h +++ b/subsys/bluetooth/audio/bap_iso.h @@ -7,9 +7,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include +#include + +#include #include #include +#include +#include struct bt_bap_iso_dir { struct bt_bap_stream *stream; diff --git a/subsys/bluetooth/audio/bap_scan_delegator.c b/subsys/bluetooth/audio/bap_scan_delegator.c index 6a55d7da2c3..6ba46a49c1f 100644 --- a/subsys/bluetooth/audio/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/bap_scan_delegator.c @@ -7,21 +7,36 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include #include #include #include -#include - -#include -#include -#include -#include -#include - -#include - LOG_MODULE_REGISTER(bt_bap_scan_delegator, CONFIG_BT_BAP_SCAN_DELEGATOR_LOG_LEVEL); #include "common/bt_str.h" diff --git a/subsys/bluetooth/audio/bap_stream.c b/subsys/bluetooth/audio/bap_stream.c index 0894af516a1..fa17e2d138e 100644 --- a/subsys/bluetooth/audio/bap_stream.c +++ b/subsys/bluetooth/audio/bap_stream.c @@ -7,28 +7,39 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include #include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "../host/iso_internal.h" -#include "bap_iso.h" #include "audio_internal.h" +#include "bap_iso.h" #include "bap_endpoint.h" #include "bap_unicast_client_internal.h" #include "bap_unicast_server.h" -#include - LOG_MODULE_REGISTER(bt_bap_stream, CONFIG_BT_BAP_STREAM_LOG_LEVEL); #if defined(CONFIG_BT_BAP_UNICAST_CLIENT) || defined(CONFIG_BT_BAP_BROADCAST_SOURCE) || \ diff --git a/subsys/bluetooth/audio/bap_stream.h b/subsys/bluetooth/audio/bap_stream.h index 3d02c2cf30c..597bf80d94c 100644 --- a/subsys/bluetooth/audio/bap_stream.h +++ b/subsys/bluetooth/audio/bap_stream.h @@ -7,6 +7,14 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include +#include + +#include +#include +#include +#include + void bt_bap_stream_init(struct bt_bap_stream *stream); /* Disconnect ISO channel */ diff --git a/subsys/bluetooth/audio/bap_unicast_client.c b/subsys/bluetooth/audio/bap_unicast_client.c index 3de389618f4..236733c9c6b 100644 --- a/subsys/bluetooth/audio/bap_unicast_client.c +++ b/subsys/bluetooth/audio/bap_unicast_client.c @@ -9,28 +9,46 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "../host/hci_core.h" #include "../host/conn_internal.h" #include "../host/iso_internal.h" -#include "bap_iso.h" +#include "ascs_internal.h" #include "audio_internal.h" +#include "bap_iso.h" #include "bap_endpoint.h" -#include "pacs_internal.h" #include "bap_unicast_client_internal.h" - -#include +#include "pacs_internal.h" BUILD_ASSERT(CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT > 0 || CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT > 0, @@ -1752,7 +1770,6 @@ static int unicast_client_ep_config(struct bt_bap_ep *ep, struct net_buf_simple const struct bt_audio_codec_cfg *codec_cfg) { struct bt_ascs_config *req; - uint8_t cc_len; LOG_DBG("ep %p buf %p codec %p", ep, buf, codec_cfg); @@ -1784,7 +1801,6 @@ static int unicast_client_ep_config(struct bt_bap_ep *ep, struct net_buf_simple req->codec.cid = codec_cfg->cid; req->codec.vid = codec_cfg->vid; - cc_len = buf->len; req->cc_len = codec_cfg->data_len; net_buf_simple_add_mem(buf, codec_cfg->data, codec_cfg->data_len); @@ -2795,7 +2811,6 @@ int bt_bap_unicast_client_qos(struct bt_conn *conn, struct bt_bap_unicast_group struct net_buf_simple *buf; struct bt_bap_ep *ep; bool conn_stream_found; - bool cig_connected; int err; if (conn == NULL) { @@ -2809,11 +2824,6 @@ int bt_bap_unicast_client_qos(struct bt_conn *conn, struct bt_bap_unicast_group */ conn_stream_found = false; - /* User to determine if any stream in the group is in - * the connected state - */ - cig_connected = false; - /* Validate streams before starting the QoS execution */ SYS_SLIST_FOR_EACH_CONTAINER(&group->streams, stream, _node) { if (stream->conn != conn) { @@ -3292,7 +3302,7 @@ static uint8_t unicast_client_ase_read_func(struct bt_conn *conn, uint8_t err, unicast_client_ep_set_status(ep, buf); cb_err = unicast_client_ep_subscribe(conn, ep); if (cb_err != 0) { - LOG_DBG("Failed to subcribe to ep %p: %d", ep, cb_err); + LOG_DBG("Failed to subscribe to ep %p: %d", ep, cb_err); goto fail; } @@ -3764,7 +3774,6 @@ static uint8_t unicast_client_pacs_context_read_func(struct bt_conn *conn, uint8 struct net_buf_simple buf; struct bt_pacs_context *context; int cb_err; - int index; memset(read, 0, sizeof(*read)); @@ -3777,8 +3786,6 @@ static uint8_t unicast_client_pacs_context_read_func(struct bt_conn *conn, uint8 net_buf_simple_init_with_data(&buf, (void *)data, length); context = net_buf_simple_pull_mem(&buf, sizeof(*context)); - index = bt_conn_index(conn); - discover_loc: /* Read ASE instances */ cb_err = unicast_client_pacs_location_discover(conn); diff --git a/subsys/bluetooth/audio/bap_unicast_client_internal.h b/subsys/bluetooth/audio/bap_unicast_client_internal.h index 56542365ac6..8e279ad652d 100644 --- a/subsys/bluetooth/audio/bap_unicast_client_internal.h +++ b/subsys/bluetooth/audio/bap_unicast_client_internal.h @@ -6,6 +6,14 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + +#include +#include +#include +#include +#include + int bt_bap_unicast_client_config(struct bt_bap_stream *stream, const struct bt_audio_codec_cfg *codec_cfg); diff --git a/subsys/bluetooth/audio/bap_unicast_server.c b/subsys/bluetooth/audio/bap_unicast_server.c index 911ca7f7d7a..0c631186c03 100644 --- a/subsys/bluetooth/audio/bap_unicast_server.c +++ b/subsys/bluetooth/audio/bap_unicast_server.c @@ -5,17 +5,24 @@ * * SPDX-License-Identifier: Apache-2.0 */ +#include +#include +#include +#include +#include -#include - +#include #include #include - -#include "bap_iso.h" -#include "pacs_internal.h" -#include "bap_endpoint.h" - +#include +#include #include +#include + +#include "ascs_internal.h" +#include "bap_iso.h" +#include "bap_endpoint.h" +#include "pacs_internal.h" LOG_MODULE_REGISTER(bt_bap_unicast_server, CONFIG_BT_BAP_UNICAST_SERVER_LOG_LEVEL); diff --git a/subsys/bluetooth/audio/bap_unicast_server.h b/subsys/bluetooth/audio/bap_unicast_server.h index 7aef4f4bc2b..34f204e267c 100644 --- a/subsys/bluetooth/audio/bap_unicast_server.h +++ b/subsys/bluetooth/audio/bap_unicast_server.h @@ -6,6 +6,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include +#include + #include #include diff --git a/subsys/bluetooth/audio/cap_acceptor.c b/subsys/bluetooth/audio/cap_acceptor.c index d84fad1e8fb..f8365eccade 100644 --- a/subsys/bluetooth/audio/cap_acceptor.c +++ b/subsys/bluetooth/audio/cap_acceptor.c @@ -4,13 +4,22 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include +#include +#include +#include + +#include #include #include #include -#include "cap_internal.h" - +#include +#include #include +#include +#include + +#include "cap_internal.h" LOG_MODULE_REGISTER(bt_cap_acceptor, CONFIG_BT_CAP_ACCEPTOR_LOG_LEVEL); diff --git a/subsys/bluetooth/audio/cap_commander.c b/subsys/bluetooth/audio/cap_commander.c index fcd28d92fd6..8f7d98bac4b 100644 --- a/subsys/bluetooth/audio/cap_commander.c +++ b/subsys/bluetooth/audio/cap_commander.c @@ -4,20 +4,34 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include +#include +#include +#include +#include +#include + +#include +#include #include +#include #include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bap_endpoint.h" #include "bap_internal.h" #include "cap_internal.h" -#include "ccid_internal.h" #include "csip_internal.h" -#include "bap_endpoint.h" - -#include LOG_MODULE_REGISTER(bt_cap_commander, CONFIG_BT_CAP_COMMANDER_LOG_LEVEL); diff --git a/subsys/bluetooth/audio/cap_initiator.c b/subsys/bluetooth/audio/cap_initiator.c index 61257e8a013..f5a6adfde71 100644 --- a/subsys/bluetooth/audio/cap_initiator.c +++ b/subsys/bluetooth/audio/cap_initiator.c @@ -4,6 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include #include #include #include @@ -16,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -25,10 +27,10 @@ #include #include +#include "bap_endpoint.h" #include "cap_internal.h" #include "ccid_internal.h" #include "csip_internal.h" -#include "bap_endpoint.h" LOG_MODULE_REGISTER(bt_cap_initiator, CONFIG_BT_CAP_INITIATOR_LOG_LEVEL); diff --git a/subsys/bluetooth/audio/cap_internal.h b/subsys/bluetooth/audio/cap_internal.h index e460fce98dc..839d4a31757 100644 --- a/subsys/bluetooth/audio/cap_internal.h +++ b/subsys/bluetooth/audio/cap_internal.h @@ -8,17 +8,19 @@ #include #include +#include +#include #include -#include -#include -#include -#include -#include #include #include #include +#include +#include +#include +#include #include +#include bool bt_cap_acceptor_ccid_exist(const struct bt_conn *conn, uint8_t ccid); diff --git a/subsys/bluetooth/audio/cap_stream.c b/subsys/bluetooth/audio/cap_stream.c index 46009b36a47..ebebeb2eb5f 100644 --- a/subsys/bluetooth/audio/cap_stream.c +++ b/subsys/bluetooth/audio/cap_stream.c @@ -5,10 +5,10 @@ */ #include -#include -#include #include +#include +#include #include #include #include @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/subsys/bluetooth/audio/ccid.c b/subsys/bluetooth/audio/ccid.c index c3a9d6a2b42..60991a54a8b 100644 --- a/subsys/bluetooth/audio/ccid.c +++ b/subsys/bluetooth/audio/ccid.c @@ -6,9 +6,14 @@ * * SPDX-License-Identifier: Apache-2.0 */ +#include +#include +#include + #include #include #include +#include #include "ccid_internal.h" diff --git a/subsys/bluetooth/audio/ccid_internal.h b/subsys/bluetooth/audio/ccid_internal.h index bf48877529d..b67331f00a3 100644 --- a/subsys/bluetooth/audio/ccid_internal.h +++ b/subsys/bluetooth/audio/ccid_internal.h @@ -10,7 +10,9 @@ #ifndef ZEPHYR_INCLUDE_BLUETOOTH_CCID_H_ #define ZEPHYR_INCLUDE_BLUETOOTH_CCID_H_ -#include +#include + +#include /** * @brief Gets a free CCID value. diff --git a/subsys/bluetooth/audio/codec.c b/subsys/bluetooth/audio/codec.c index 86936d58a8e..208448646fc 100644 --- a/subsys/bluetooth/audio/codec.c +++ b/subsys/bluetooth/audio/codec.c @@ -10,13 +10,21 @@ * Generic Audio. */ +#include +#include +#include +#include #include +#include +#include #include +#include +#include +#include #include #include - -#include +#include LOG_MODULE_REGISTER(bt_audio_codec, CONFIG_BT_AUDIO_CODEC_LOG_LEVEL); diff --git a/subsys/bluetooth/audio/csip_crypto.c b/subsys/bluetooth/audio/csip_crypto.c index 0efe1fec5a2..08346bed0bd 100644 --- a/subsys/bluetooth/audio/csip_crypto.c +++ b/subsys/bluetooth/audio/csip_crypto.c @@ -9,16 +9,23 @@ * in the CSIS spec is also provided as BE, and logging values as BE will make * it easier to compare. */ -#include "csip_crypto.h" +#include +#include +#include + +#include +#include #include +#include #include #include +#include #include "crypto/bt_crypto.h" #include "common/bt_str.h" -#include +#include "csip_crypto.h" LOG_MODULE_REGISTER(bt_csip_crypto, CONFIG_BT_CSIP_SET_MEMBER_CRYPTO_LOG_LEVEL); diff --git a/subsys/bluetooth/audio/csip_crypto.h b/subsys/bluetooth/audio/csip_crypto.h index 1a41bf32d54..b522eb94a98 100644 --- a/subsys/bluetooth/audio/csip_crypto.h +++ b/subsys/bluetooth/audio/csip_crypto.h @@ -5,10 +5,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include +#include #include +#include #define BT_CSIP_CRYPTO_KEY_SIZE 16 #define BT_CSIP_CRYPTO_SALT_SIZE 16 diff --git a/subsys/bluetooth/audio/csip_internal.h b/subsys/bluetooth/audio/csip_internal.h index 6335e664c40..0ac61f335c0 100644 --- a/subsys/bluetooth/audio/csip_internal.h +++ b/subsys/bluetooth/audio/csip_internal.h @@ -7,8 +7,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include +#include +#include +#include #define BT_CSIP_SIRK_TYPE_ENCRYPTED 0x00 #define BT_CSIP_SIRK_TYPE_PLAIN 0x01 diff --git a/subsys/bluetooth/audio/csip_set_coordinator.c b/subsys/bluetooth/audio/csip_set_coordinator.c index b9d6f251a8b..fea61e131b6 100644 --- a/subsys/bluetooth/audio/csip_set_coordinator.c +++ b/subsys/bluetooth/audio/csip_set_coordinator.c @@ -18,27 +18,41 @@ * 10) Unlock all members */ +#include +#include +#include +#include #include -#include -#include - -#include -#include -#include +#include +#include +#include +#include #include #include +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include "csip_crypto.h" -#include "csip_internal.h" + #include "../host/conn_internal.h" #include "../host/keys.h" -#include "common/bt_str.h" -#include +#include "csip_crypto.h" +#include "csip_internal.h" +#include "common/bt_str.h" LOG_MODULE_REGISTER(bt_csip_set_coordinator, CONFIG_BT_CSIP_SET_COORDINATOR_LOG_LEVEL); diff --git a/subsys/bluetooth/audio/csip_set_member.c b/subsys/bluetooth/audio/csip_set_member.c index d038020f9c8..f3e91beb8a5 100644 --- a/subsys/bluetooth/audio/csip_set_member.c +++ b/subsys/bluetooth/audio/csip_set_member.c @@ -6,37 +6,51 @@ * * SPDX-License-Identifier: Apache-2.0 */ - -#include -#include - -#include -#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include #include #include +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include "audio_internal.h" -#include "csip_internal.h" -#include "csip_crypto.h" #include "../host/conn_internal.h" #include "../host/hci_core.h" #include "../host/keys.h" +#include "common/bt_str.h" +#include "audio_internal.h" +#include "csip_internal.h" +#include "csip_crypto.h" + #define CSIP_SET_LOCK_TIMER_VALUE K_SECONDS(60) #define CSIS_CHAR_ATTR_COUNT 3 /* declaration + value + cccd */ #define CSIS_RANK_CHAR_ATTR_COUNT 2 /* declaration + value */ -#include "common/bt_str.h" - -#include - LOG_MODULE_REGISTER(bt_csip_set_member, CONFIG_BT_CSIP_SET_MEMBER_LOG_LEVEL); enum csip_flag { diff --git a/subsys/bluetooth/audio/gmap_client.c b/subsys/bluetooth/audio/gmap_client.c index dff67356b76..8f4fb74ffa0 100644 --- a/subsys/bluetooth/audio/gmap_client.c +++ b/subsys/bluetooth/audio/gmap_client.c @@ -4,9 +4,21 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include +#include +#include +#include +#include + +#include +#include #include +#include +#include +#include #include +#include +#include #include #include "audio_internal.h" diff --git a/subsys/bluetooth/audio/gmap_server.c b/subsys/bluetooth/audio/gmap_server.c index 5bc16ee686f..d80003bf210 100644 --- a/subsys/bluetooth/audio/gmap_server.c +++ b/subsys/bluetooth/audio/gmap_server.c @@ -3,12 +3,22 @@ * * SPDX-License-Identifier: Apache-2.0 */ +#include +#include +#include +#include +#include +#include -#include +#include #include -#include - +#include +#include +#include #include +#include +#include +#include #include "audio_internal.h" diff --git a/subsys/bluetooth/audio/has.c b/subsys/bluetooth/audio/has.c index b018e034bb7..f90c54159cd 100644 --- a/subsys/bluetooth/audio/has.c +++ b/subsys/bluetooth/audio/has.c @@ -4,24 +4,42 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include +#include +#include +#include +#include +#include -#include -#include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include +#include +#include +#include #include "../bluetooth/host/hci_core.h" #include "../bluetooth/host/settings.h" + #include "audio_internal.h" -#include "has_internal.h" - #include "common/bt_str.h" - -#include +#include "has_internal.h" LOG_MODULE_REGISTER(bt_has, CONFIG_BT_HAS_LOG_LEVEL); @@ -184,7 +202,7 @@ static struct client_context { uint8_t last_preset_index_known; } contexts[CONFIG_BT_MAX_PAIRED]; -/* Connected client clientance */ +/* Connected client instance */ static struct has_client { struct bt_conn *conn; #if defined(CONFIG_BT_HAS_PRESET_SUPPORT) @@ -919,7 +937,7 @@ static int settings_set_cb(const char *name, size_t len_rd, settings_read_cb rea return 0; } -BT_SETTINGS_DEFINE(has, "has", settings_set_cb, NULL); +static BT_SETTINGS_DEFINE(has, "has", settings_set_cb, NULL); static void store_client_context(struct client_context *context) { diff --git a/subsys/bluetooth/audio/has_client.c b/subsys/bluetooth/audio/has_client.c index 9ac33139a96..0426cf9dbe3 100644 --- a/subsys/bluetooth/audio/has_client.c +++ b/subsys/bluetooth/audio/has_client.c @@ -3,20 +3,29 @@ * * SPDX-License-Identifier: Apache-2.0 */ +#include +#include +#include +#include +#include -#include - -#include -#include +#include +#include #include +#include +#include +#include +#include +#include +#include #include #include #include +#include +#include #include "has_internal.h" -#include - LOG_MODULE_REGISTER(bt_has_client, CONFIG_BT_HAS_CLIENT_LOG_LEVEL); #define HAS_INST(_has) CONTAINER_OF(_has, struct bt_has_client, has) diff --git a/subsys/bluetooth/audio/has_internal.h b/subsys/bluetooth/audio/has_internal.h index 5c5dc6b9410..97b4d2017ae 100644 --- a/subsys/bluetooth/audio/has_internal.h +++ b/subsys/bluetooth/audio/has_internal.h @@ -8,8 +8,14 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include +#include + #include #include +#include +#include +#include /* Control Point opcodes */ #define BT_HAS_OP_READ_PRESET_REQ 0x01 diff --git a/subsys/bluetooth/audio/mcc.c b/subsys/bluetooth/audio/mcc.c index e192c0352db..38929ab19cd 100644 --- a/subsys/bluetooth/audio/mcc.c +++ b/subsys/bluetooth/audio/mcc.c @@ -7,22 +7,38 @@ * * SPDX-License-Identifier: Apache-2.0 */ +#include +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include - +#include +#include +#include +#include +#include #include #include #include -#include -#include "mcc_internal.h" - #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "../services/ots/ots_client_internal.h" +#include "common/bt_str.h" +#include "mcc_internal.h" #include "mcs_internal.h" /* TODO: Temporarily copied here from media_proxy_internal.h - clean up */ @@ -38,13 +54,8 @@ } \ } while (0) - -#include - LOG_MODULE_REGISTER(bt_mcc, CONFIG_BT_MCC_LOG_LEVEL); -#include "common/bt_str.h" - static struct mcs_instance_t mcs_instance; static struct bt_uuid_16 uuid = BT_UUID_INIT_16(0); diff --git a/subsys/bluetooth/audio/mcc_internal.h b/subsys/bluetooth/audio/mcc_internal.h index 2838e53ba35..603977a70f3 100644 --- a/subsys/bluetooth/audio/mcc_internal.h +++ b/subsys/bluetooth/audio/mcc_internal.h @@ -11,10 +11,15 @@ #ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_MCP_INTERNAL_ #define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_MCP_INTERNAL_ -#include +#include +#include + +#include +#include +#include #include #include -#include "../services/ots/ots_client_internal.h" +#include struct mcs_instance_t *lookup_inst_by_conn(struct bt_conn *conn); diff --git a/subsys/bluetooth/audio/mcs.c b/subsys/bluetooth/audio/mcs.c index 271ea690ad7..d0eb2f7658b 100644 --- a/subsys/bluetooth/audio/mcs.c +++ b/subsys/bluetooth/audio/mcs.c @@ -8,29 +8,37 @@ * SPDX-License-Identifier: Apache-2.0 */ - -#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include #include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "audio_internal.h" #include "media_proxy_internal.h" #include "mcs_internal.h" -#include - LOG_MODULE_REGISTER(bt_mcs, CONFIG_BT_MCS_LOG_LEVEL); static void notify(const struct bt_uuid *uuid, const void *data, uint16_t len); @@ -986,7 +994,7 @@ static void notify_string(struct bt_conn *conn, const struct bt_uuid *uuid, cons __ASSERT(att_mtu > att_header_size, "Could not get valid ATT MTU"); maxlen = att_mtu - att_header_size; /* Subtract opcode and handle */ - /* Send notifcation potentially truncated to the MTU */ + /* Send notification potentially truncated to the MTU */ err = bt_gatt_notify_uuid(conn, uuid, mcs.attrs, (void *)str, MIN(strlen(str), maxlen)); if (err != 0) { diff --git a/subsys/bluetooth/audio/mcs_internal.h b/subsys/bluetooth/audio/mcs_internal.h index 3bbce49fa14..e2a16049541 100644 --- a/subsys/bluetooth/audio/mcs_internal.h +++ b/subsys/bluetooth/audio/mcs_internal.h @@ -8,9 +8,8 @@ #ifndef ZEPHYR_SUBSYS_BLUETOOTH_HOST_AUDIO_MCS_INTERNAL_H_ #define ZEPHYR_SUBSYS_BLUETOOTH_HOST_AUDIO_MCS_INTERNAL_H_ -#include -#include -#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/subsys/bluetooth/audio/media_proxy.c b/subsys/bluetooth/audio/media_proxy.c index e816b1f20a0..54e567de101 100644 --- a/subsys/bluetooth/audio/media_proxy.c +++ b/subsys/bluetooth/audio/media_proxy.c @@ -6,17 +6,22 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include +#include +#include +#include -#include +#include #include #include +#include +#include +#include +#include #include "media_proxy_internal.h" #include "mcs_internal.h" -#include - LOG_MODULE_REGISTER(media_proxy, CONFIG_MCTL_LOG_LEVEL); /* Media player */ diff --git a/subsys/bluetooth/audio/media_proxy_internal.h b/subsys/bluetooth/audio/media_proxy_internal.h index 37f5e599767..6a24f80d11b 100644 --- a/subsys/bluetooth/audio/media_proxy_internal.h +++ b/subsys/bluetooth/audio/media_proxy_internal.h @@ -9,7 +9,11 @@ /** @brief Internal APIs for Bluetooth Media Control */ +#include + +#include #include +#include #define MPL_NO_TRACK_ID 0 diff --git a/subsys/bluetooth/audio/micp_internal.h b/subsys/bluetooth/audio/micp_internal.h index ce486bf6fe6..d23d655133b 100644 --- a/subsys/bluetooth/audio/micp_internal.h +++ b/subsys/bluetooth/audio/micp_internal.h @@ -12,7 +12,11 @@ #ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_MICP_INTERNAL_ #define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_MICP_INTERNAL_ -#include +#include +#include + +#include +#include #include struct bt_micp_mic_ctlr { diff --git a/subsys/bluetooth/audio/micp_mic_ctlr.c b/subsys/bluetooth/audio/micp_mic_ctlr.c index 45190b7c9b4..9b3605f7efe 100644 --- a/subsys/bluetooth/audio/micp_mic_ctlr.c +++ b/subsys/bluetooth/audio/micp_mic_ctlr.c @@ -7,26 +7,36 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include - -#include - -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include "common/bt_str.h" #include "micp_internal.h" LOG_MODULE_REGISTER(bt_micp_mic_ctlr, CONFIG_BT_MICP_MIC_CTLR_LOG_LEVEL); -#include "common/bt_str.h" - /* Callback functions */ static sys_slist_t micp_mic_ctlr_cbs = SYS_SLIST_STATIC_INIT(&micp_mic_ctlr_cbs); diff --git a/subsys/bluetooth/audio/micp_mic_dev.c b/subsys/bluetooth/audio/micp_mic_dev.c index e282845936a..1bc1e10b43e 100644 --- a/subsys/bluetooth/audio/micp_mic_dev.c +++ b/subsys/bluetooth/audio/micp_mic_dev.c @@ -6,23 +6,32 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include -#include - -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "audio_internal.h" -#include - LOG_MODULE_REGISTER(bt_micp, CONFIG_BT_MICP_MIC_DEV_LOG_LEVEL); struct bt_micp_server { diff --git a/subsys/bluetooth/audio/mpl.c b/subsys/bluetooth/audio/mpl.c index 111482b3e04..a80429ee80e 100644 --- a/subsys/bluetooth/audio/mpl.c +++ b/subsys/bluetooth/audio/mpl.c @@ -6,24 +6,34 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include #include #include - -#include -#include - -#include "media_proxy_internal.h" -#include "mpl_internal.h" - -#include - -LOG_MODULE_REGISTER(bt_mpl, CONFIG_BT_MPL_LOG_LEVEL); +#include #include "ccid_internal.h" +#include "media_proxy_internal.h" #include "mcs_internal.h" +#include "mpl_internal.h" + +LOG_MODULE_REGISTER(bt_mpl, CONFIG_BT_MPL_LOG_LEVEL); #define TRACK_STATUS_INVALID 0x00 #define TRACK_STATUS_VALID 0x01 @@ -395,7 +405,7 @@ static uint32_t setup_parent_group_object(struct mpl_group *group) /* The implementation has a fixed structure, with one parent group, */ /* and one level of groups containing tracks only. */ /* The track groups have a pointer to the parent, but there is no */ - /* poinbter in the other direction, so it is not possible to go from */ + /* pointer in the other direction, so it is not possible to go from */ /* the parent group to a group of tracks. */ uint8_t type = MEDIA_PROXY_GROUP_OBJECT_GROUP_TYPE; diff --git a/subsys/bluetooth/audio/mpl_internal.h b/subsys/bluetooth/audio/mpl_internal.h index c8a553da216..e2444137192 100644 --- a/subsys/bluetooth/audio/mpl_internal.h +++ b/subsys/bluetooth/audio/mpl_internal.h @@ -10,6 +10,13 @@ #ifndef ZEPHYR_SUBSYS_BLUETOOTH_AUDIO_MPL_INTERNAL_ #define ZEPHYR_SUBSYS_BLUETOOTH_AUDIO_MPL_INTERNAL_ +#include +#include + +#include +#include +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/subsys/bluetooth/audio/pacs.c b/subsys/bluetooth/audio/pacs.c index 64f750523ff..bbad4ee89da 100644 --- a/subsys/bluetooth/audio/pacs.c +++ b/subsys/bluetooth/audio/pacs.c @@ -9,31 +9,44 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include -#include - -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include + #include "../host/conn_internal.h" #include "../host/hci_core.h" - -#include - -LOG_MODULE_REGISTER(bt_pacs, CONFIG_BT_PACS_LOG_LEVEL); - #include "common/bt_str.h" #include "audio_internal.h" -#include "pacs_internal.h" #include "bap_unicast_server.h" +#include "pacs_internal.h" + +LOG_MODULE_REGISTER(bt_pacs, CONFIG_BT_PACS_LOG_LEVEL); #define PAC_NOTIFY_TIMEOUT K_MSEC(10) #define READ_BUF_SEM_TIMEOUT K_MSEC(50) diff --git a/subsys/bluetooth/audio/pacs_internal.h b/subsys/bluetooth/audio/pacs_internal.h index 2c449f7f4ad..8fe715e57ba 100644 --- a/subsys/bluetooth/audio/pacs_internal.h +++ b/subsys/bluetooth/audio/pacs_internal.h @@ -7,7 +7,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include + +#include #define BT_AUDIO_LOCATION_MASK BIT_MASK(28) diff --git a/subsys/bluetooth/audio/pbp.c b/subsys/bluetooth/audio/pbp.c index 3b624045de2..ab3ab4822e9 100644 --- a/subsys/bluetooth/audio/pbp.c +++ b/subsys/bluetooth/audio/pbp.c @@ -3,14 +3,21 @@ * * SPDX-License-Identifier: Apache-2.0 */ +#include +#include +#include -#include -#include -#include +#include #include #include +#include +#include +#include #include +#include +#include #include +#include LOG_MODULE_REGISTER(bt_pbp, CONFIG_BT_PBP_LOG_LEVEL); diff --git a/subsys/bluetooth/audio/shell/audio.h b/subsys/bluetooth/audio/shell/audio.h index 63fb699ad99..02d7618cb60 100644 --- a/subsys/bluetooth/audio/shell/audio.h +++ b/subsys/bluetooth/audio/shell/audio.h @@ -10,15 +10,27 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef __AUDIO_H -#define __AUDIO_H +#ifndef AUDIO_SHELL_AUDIO_H +#define AUDIO_SHELL_AUDIO_H +#include +#include +#include #include +#include +#include +#include #include +#include +#include #include +#include #include #include +#include +#include +#include #include "shell/bt.h" @@ -1159,4 +1171,4 @@ static inline void copy_broadcast_source_preset(struct broadcast_source *source, } #endif /* CONFIG_BT_AUDIO */ -#endif /* __AUDIO_H */ +#endif /* AUDIO_SHELL_AUDIO_H */ diff --git a/subsys/bluetooth/audio/shell/bap.c b/subsys/bluetooth/audio/shell/bap.c index e63b2d559d1..a400555dd76 100644 --- a/subsys/bluetooth/audio/shell/bap.c +++ b/subsys/bluetooth/audio/shell/bap.c @@ -10,22 +10,42 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -#include +#include #include #include #include #include #include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "shell/bt.h" #include "audio.h" @@ -192,6 +212,8 @@ void bap_foreach_stream(void (*func)(struct shell_stream *sh_stream, void *data) } #if defined(CONFIG_LIBLC3) +#include + static int get_lc3_chan_alloc_from_index(const struct shell_stream *sh_stream, uint8_t index, enum bt_audio_location *chan_alloc) { @@ -4060,7 +4082,7 @@ static ssize_t connectable_ad_data_add(struct bt_data *data_array, sys_put_le16(snk_context, &ad_bap_announcement[3]); src_context = bt_pacs_get_available_contexts(BT_AUDIO_DIR_SOURCE); - sys_put_le16(snk_context, &ad_bap_announcement[5]); + sys_put_le16(src_context, &ad_bap_announcement[5]); /* Metadata length */ ad_bap_announcement[7] = 0x00; diff --git a/subsys/bluetooth/audio/shell/bap_broadcast_assistant.c b/subsys/bluetooth/audio/shell/bap_broadcast_assistant.c index ee3d7050918..85be52069ab 100644 --- a/subsys/bluetooth/audio/shell/bap_broadcast_assistant.c +++ b/subsys/bluetooth/audio/shell/bap_broadcast_assistant.c @@ -7,18 +7,30 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include -#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include #include "shell/bt.h" #include "../../host/hci_core.h" diff --git a/subsys/bluetooth/audio/shell/bap_scan_delegator.c b/subsys/bluetooth/audio/shell/bap_scan_delegator.c index 9c0789eabb1..e31a85c064d 100644 --- a/subsys/bluetooth/audio/shell/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/shell/bap_scan_delegator.c @@ -7,22 +7,36 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include #include