Skip to content

Commit dbabc18

Browse files
Thalleykartben
authored andcommitted
samples: Bluetooth: Audio: Spring cleanup for audio header files
Add missing and remove unused includes. Fix spelling mistakes. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
1 parent f460510 commit dbabc18

File tree

15 files changed

+70
-33
lines changed

15 files changed

+70
-33
lines changed

samples/bluetooth/bap_broadcast_sink/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ config MAX_CODEC_FRAMES_PER_SDU
4141
range 1 255
4242
help
4343
Maximum number of codec frames per SDU supported by this device. Increasing this value
44-
allows support for a greater variaty of broadcasts, but also increases memory usage.
44+
allows support for a greater variety of broadcasts, but also increases memory usage.
4545

4646
config ENABLE_LC3
4747
bool "Enable the LC3 codec"

samples/bluetooth/bap_broadcast_source/src/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <zephyr/bluetooth/audio/bap_lc3_preset.h>
1616
#include <zephyr/bluetooth/bluetooth.h>
1717
#include <zephyr/bluetooth/byteorder.h>
18+
#include <zephyr/bluetooth/crypto.h>
1819
#include <zephyr/bluetooth/gap.h>
1920
#include <zephyr/bluetooth/iso.h>
2021
#include <zephyr/bluetooth/uuid.h>

samples/bluetooth/cap_acceptor/src/cap_acceptor_broadcast.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,19 @@
1313
#include <strings.h>
1414

1515
#include <zephyr/autoconf.h>
16+
#include <zephyr/bluetooth/addr.h>
1617
#include <zephyr/bluetooth/audio/audio.h>
1718
#include <zephyr/bluetooth/audio/bap.h>
1819
#include <zephyr/bluetooth/audio/cap.h>
1920
#include <zephyr/bluetooth/bluetooth.h>
2021
#include <zephyr/bluetooth/conn.h>
2122
#include <zephyr/bluetooth/gap.h>
2223
#include <zephyr/bluetooth/iso.h>
24+
#include <zephyr/bluetooth/uuid.h>
2325
#include <zephyr/kernel.h>
2426
#include <zephyr/logging/log.h>
2527
#include <zephyr/logging/log_core.h>
28+
#include <zephyr/net_buf.h>
2629
#include <zephyr/sys/atomic.h>
2730
#include <zephyr/sys/byteorder.h>
2831
#include <zephyr/sys/util.h>
@@ -605,8 +608,8 @@ static bool scan_check_and_sync_broadcast(struct bt_data *data, void *user_data)
605608

606609
bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr));
607610

608-
printk("Found broadcaster with ID 0x%06X and addr %s and sid 0x%02X\n", broadcast_id,
609-
le_addr, info->sid);
611+
LOG_INF("Found broadcaster with ID 0x%06X and addr %s and sid 0x%02X\n", broadcast_id,
612+
le_addr, info->sid);
610613

611614
bt_addr_le_copy(&param.addr, info->addr);
612615
param.options = BT_LE_PER_ADV_SYNC_OPT_FILTER_DUPLICATE;

samples/bluetooth/cap_initiator/src/cap_initiator_broadcast.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <zephyr/bluetooth/audio/cap.h>
1313
#include <zephyr/bluetooth/audio/bap.h>
1414
#include <zephyr/bluetooth/bluetooth.h>
15+
#include <zephyr/bluetooth/crypto.h>
1516
#include <zephyr/bluetooth/gap.h>
1617
#include <zephyr/bluetooth/uuid.h>
1718
#include <zephyr/kernel.h>
@@ -138,7 +139,7 @@ static int setup_extended_adv_data(struct bt_cap_broadcast_source *source,
138139
#else
139140
err = bt_rand(&broadcast_id, BT_AUDIO_BROADCAST_ID_SIZE);
140141
if (err) {
141-
printk("Unable to generate broadcast ID: %d\n", err);
142+
LOG_ERR("Unable to generate broadcast ID: %d\n", err);
142143
return err;
143144
}
144145
#endif /* CONFIG_STATIC_BROADCAST_ID */

samples/bluetooth/hap_ha/src/bap_unicast_sr.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,28 @@
66
*
77
* SPDX-License-Identifier: Apache-2.0
88
*/
9+
#include <errno.h>
10+
#include <stddef.h>
11+
#include <stdint.h>
12+
#include <string.h>
913

10-
#include <zephyr/kernel.h>
11-
#include <zephyr/sys/byteorder.h>
12-
#include <zephyr/sys/printk.h>
13-
14+
#include <zephyr/bluetooth/addr.h>
15+
#include <zephyr/bluetooth/audio/lc3.h>
1416
#include <zephyr/bluetooth/bluetooth.h>
1517
#include <zephyr/bluetooth/conn.h>
18+
#include <zephyr/bluetooth/gap.h>
1619
#include <zephyr/bluetooth/hci.h>
1720
#include <zephyr/bluetooth/audio/audio.h>
1821
#include <zephyr/bluetooth/audio/bap.h>
1922
#include <zephyr/bluetooth/audio/pacs.h>
23+
#include <zephyr/bluetooth/hci_types.h>
24+
#include <zephyr/bluetooth/iso.h>
25+
#include <zephyr/kernel.h>
26+
#include <zephyr/net_buf.h>
27+
#include <zephyr/sys/byteorder.h>
28+
#include <zephyr/sys/printk.h>
29+
#include <zephyr/sys/util.h>
30+
#include <zephyr/sys/util_macro.h>
2031

2132
NET_BUF_POOL_FIXED_DEFINE(tx_pool, CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT,
2233
BT_ISO_SDU_BUF_SIZE(CONFIG_BT_ISO_TX_MTU),

samples/bluetooth/hap_ha/src/ccp_call_ctrl.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66
*
77
* SPDX-License-Identifier: Apache-2.0
88
*/
9+
#include <stdint.h>
910

10-
#include <zephyr/kernel.h>
11-
#include <zephyr/sys/printk.h>
12-
#include <zephyr/sys/util.h>
13-
11+
#include <zephyr/autoconf.h>
1412
#include <zephyr/bluetooth/conn.h>
1513
#include <zephyr/bluetooth/hci.h>
1614
#include <zephyr/bluetooth/audio/tbs.h>
15+
#include <zephyr/kernel.h>
16+
#include <zephyr/sys/atomic.h>
17+
#include <zephyr/sys/printk.h>
18+
#include <zephyr/sys/util.h>
1719

1820
enum {
1921
CCP_FLAG_PROFILE_CONNECTED,

samples/bluetooth/hap_ha/src/csip_set_member.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55
*
66
* SPDX-License-Identifier: Apache-2.0
77
*/
8+
#include <errno.h>
9+
#include <stddef.h>
10+
#include <stdint.h>
811

9-
#include <zephyr/kernel.h>
10-
#include <zephyr/sys/printk.h>
11-
12+
#include <zephyr/autoconf.h>
1213
#include <zephyr/bluetooth/audio/cap.h>
1314
#include <zephyr/bluetooth/audio/csip.h>
15+
#include <zephyr/bluetooth/conn.h>
16+
#include <zephyr/kernel.h>
17+
#include <zephyr/sys/printk.h>
1418

1519
#define CSIP_SIRK_DEBUG { 0xcd, 0xcc, 0x72, 0xdd, 0x86, 0x8c, 0xcd, 0xce, \
1620
0x22, 0xfd, 0xa1, 0x21, 0x09, 0x7d, 0x7d, 0x45 }

samples/bluetooth/hap_ha/src/hap_ha.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#include <zephyr/types.h>
7+
#include <stdint.h>
88

99
/**
1010
* @brief Initialize the BAP Unicast Server role

samples/bluetooth/hap_ha/src/has_server.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
*
66
* SPDX-License-Identifier: Apache-2.0
77
*/
8+
#include <stddef.h>
9+
#include <stdint.h>
810

11+
#include <zephyr/autoconf.h>
12+
#include <zephyr/bluetooth/audio/has.h>
913
#include <zephyr/kernel.h>
1014
#include <zephyr/sys/printk.h>
1115
#include <zephyr/sys/util.h>
12-
13-
#include <zephyr/bluetooth/audio/has.h>
16+
#include <zephyr/sys/util_macro.h>
1417

1518
#define PRESET_INDEX_UNIVERSAL 1
1619
#define PRESET_INDEX_OUTDOOR 5

samples/bluetooth/hap_ha/src/main.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6-
7-
#include <zephyr/kernel.h>
8-
#include <zephyr/sys/byteorder.h>
9-
#include <zephyr/sys/printk.h>
6+
#include <stddef.h>
7+
#include <stdint.h>
108

119
#include <zephyr/bluetooth/bluetooth.h>
1210
#include <zephyr/bluetooth/byteorder.h>
@@ -15,7 +13,15 @@
1513
#include <zephyr/bluetooth/audio/bap.h>
1614
#include <zephyr/bluetooth/audio/pacs.h>
1715
#include <zephyr/bluetooth/audio/csip.h>
16+
#include <zephyr/bluetooth/gap.h>
1817
#include <zephyr/bluetooth/services/ias.h>
18+
#include <zephyr/bluetooth/uuid.h>
19+
#include <zephyr/kernel.h>
20+
#include <zephyr/sys/__assert.h>
21+
#include <zephyr/sys/byteorder.h>
22+
#include <zephyr/sys/printk.h>
23+
#include <zephyr/sys/util.h>
24+
#include <zephyr/sys/util_macro.h>
1925

2026
#include "hap_ha.h"
2127

0 commit comments

Comments
 (0)