Skip to content

Commit 72d9a37

Browse files
Thalleykartben
authored andcommitted
tests: Bluetooth: Tester: Cleanup includes
Update the includes so that only what is actually used is included, and so that everything is used is includes (IWYU). Signed-off-by: Emil Gydesen <[email protected]>
1 parent e71aa64 commit 72d9a37

18 files changed

+131
-77
lines changed

tests/bluetooth/tester/src/btp.c

+15-7
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,27 @@
66
*
77
* SPDX-License-Identifier: Apache-2.0
88
*/
9-
10-
#include <zephyr/kernel.h>
9+
#include <errno.h>
1110
#include <stdio.h>
11+
#include <stdint.h>
1212
#include <string.h>
13-
#include <zephyr/types.h>
13+
14+
#include <zephyr/autoconf.h>
15+
#include <zephyr/bluetooth/bluetooth.h>
1416
#include <zephyr/device.h>
1517
#include <zephyr/drivers/uart.h>
16-
#include <zephyr/toolchain.h>
17-
#include <zephyr/bluetooth/bluetooth.h>
18-
#include <zephyr/sys/byteorder.h>
1918
#include <zephyr/drivers/uart_pipe.h>
20-
19+
#include <zephyr/kernel.h>
20+
#include <zephyr/kernel/thread_stack.h>
2121
#include <zephyr/logging/log.h>
22+
#include <zephyr/net_buf.h>
23+
#include <zephyr/sys/__assert.h>
24+
#include <zephyr/sys/byteorder.h>
25+
#include <zephyr/sys/util.h>
26+
#include <zephyr/sys_clock.h>
27+
#include <zephyr/toolchain.h>
28+
#include <zephyr/types.h>
29+
2230
#define LOG_MODULE_NAME bttester
2331
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
2432

tests/bluetooth/tester/src/btp/btp.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#ifndef TESTS_BLUETOOTH_TESTER_SRC_BTP_
1111
#define TESTS_BLUETOOTH_TESTER_SRC_BTP_
1212

13-
#include <zephyr/sys/util.h>
14-
#include <zephyr/bluetooth/addr.h>
13+
#include <stdint.h>
1514

1615
#include "bttester.h"
1716
#include "btp_core.h"

tests/bluetooth/tester/src/btp/btp_core.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
* SPDX-License-Identifier: Apache-2.0
88
*/
99

10-
#include <zephyr/sys/util.h>
11-
#include <zephyr/bluetooth/addr.h>
10+
#include <stdint.h>
1211

1312
/* Core Service */
1413
#define BTP_CORE_READ_SUPPORTED_COMMANDS 0x01

tests/bluetooth/tester/src/btp/btp_gap.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
* SPDX-License-Identifier: Apache-2.0
88
*/
99

10-
#include <zephyr/sys/util.h>
10+
#include <stddef.h>
11+
#include <stdint.h>
12+
1113
#include <zephyr/bluetooth/addr.h>
1214

1315
/* GAP Service */

tests/bluetooth/tester/src/btp/btp_gatt.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
* SPDX-License-Identifier: Apache-2.0
88
*/
99

10-
#include <zephyr/sys/util.h>
10+
#include <stdint.h>
11+
1112
#include <zephyr/bluetooth/addr.h>
1213

1314
/* GATT Service */

tests/bluetooth/tester/src/btp/btp_ias.h

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* SPDX-License-Identifier: Apache-2.0
77
*/
88

9-
#include <zephyr/bluetooth/services/ias.h>
109
#include <stdint.h>
1110

1211
/* events */

tests/bluetooth/tester/src/btp/btp_l2cap.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
* SPDX-License-Identifier: Apache-2.0
88
*/
99

10-
#include <zephyr/sys/util.h>
10+
#include <stdint.h>
11+
1112
#include <zephyr/bluetooth/addr.h>
1213

1314
/* L2CAP Service */

tests/bluetooth/tester/src/btp/btp_mesh.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
* SPDX-License-Identifier: Apache-2.0
88
*/
99

10-
#include <zephyr/sys/util.h>
10+
#include <stdint.h>
11+
1112
#include <zephyr/bluetooth/addr.h>
13+
#include <zephyr/sys/util_macro.h>
1214

1315
/* MESH Service */
1416
/* commands */

tests/bluetooth/tester/src/btp/btp_ots.h

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* SPDX-License-Identifier: Apache-2.0
77
*/
88

9+
#include <stdint.h>
10+
911
/* OTS commands */
1012
#define BTP_OTS_READ_SUPPORTED_COMMANDS 0x01
1113
struct btp_ots_read_supported_commands_rp {

tests/bluetooth/tester/src/btp/bttester.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
* SPDX-License-Identifier: Apache-2.0
88
*/
99

10-
#include <zephyr/types.h>
11-
#include <zephyr/sys/util.h>
10+
#include <stddef.h>
11+
#include <stdint.h>
12+
1213
#include <zephyr/bluetooth/addr.h>
14+
#include <zephyr/sys/util_macro.h>
1315
#include <sys/types.h>
1416

1517
static inline void tester_set_bit(uint8_t *addr, unsigned int bit)

tests/bluetooth/tester/src/btp_core.c

+9-10
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,26 @@
77
* SPDX-License-Identifier: Apache-2.0
88
*/
99

10-
#include <zephyr/sys/atomic.h>
11-
#include <zephyr/types.h>
12-
#include <string.h>
10+
#include <stdint.h>
1311

14-
#include <zephyr/toolchain.h>
12+
#include <zephyr/autoconf.h>
1513
#include <zephyr/bluetooth/bluetooth.h>
1614
#include <zephyr/bluetooth/conn.h>
1715
#include <zephyr/bluetooth/gatt.h>
1816
#include <zephyr/bluetooth/hci.h>
19-
20-
#include <zephyr/sys/byteorder.h>
17+
#include <zephyr/logging/log.h>
2118
#include <zephyr/net_buf.h>
19+
#include <zephyr/sys/atomic.h>
20+
#include <zephyr/sys/byteorder.h>
21+
#include <zephyr/sys/util.h>
22+
#include <zephyr/toolchain.h>
2223

23-
#include <hci_core.h>
24+
#include "btp/btp.h"
25+
#include "hci_core.h"
2426

25-
#include <zephyr/logging/log.h>
2627
#define LOG_MODULE_NAME bttester_core
2728
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
2829

29-
#include "btp/btp.h"
30-
3130
static ATOMIC_DEFINE(registered_services, BTP_SERVICE_ID_MAX);
3231

3332
static uint8_t supported_commands(const void *cmd, uint16_t cmd_len,

tests/bluetooth/tester/src/btp_gap.c

+16-12
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,37 @@
55
*
66
* SPDX-License-Identifier: Apache-2.0
77
*/
8+
#include <errno.h>
89
#include <stdint.h>
9-
10-
#include <zephyr/bluetooth/audio/bap.h>
11-
#include <zephyr/bluetooth/addr.h>
12-
#include <zephyr/bluetooth/gap.h>
13-
#include <zephyr/sys/atomic.h>
14-
#include <zephyr/sys/util_macro.h>
15-
#include <zephyr/types.h>
1610
#include <string.h>
1711

18-
#include <zephyr/toolchain.h>
12+
#include <zephyr/autoconf.h>
13+
#include <zephyr/bluetooth/addr.h>
14+
#include <zephyr/bluetooth/att.h>
15+
#include <zephyr/bluetooth/audio/bap.h>
1916
#include <zephyr/bluetooth/bluetooth.h>
2017
#include <zephyr/bluetooth/conn.h>
2118
#include <zephyr/bluetooth/gatt.h>
2219
#include <zephyr/bluetooth/hci.h>
20+
#include <zephyr/bluetooth/gap.h>
21+
#include <zephyr/bluetooth/hci_types.h>
22+
#include <zephyr/bluetooth/uuid.h>
23+
#include <zephyr/logging/log.h>
24+
#include <zephyr/sys/atomic.h>
25+
#include <zephyr/sys/util.h>
26+
#include <zephyr/sys/util_macro.h>
27+
#include <zephyr/toolchain.h>
28+
#include <zephyr/types.h>
2329

2430
#include <zephyr/sys/byteorder.h>
2531
#include <zephyr/net_buf.h>
2632

2733
#include <hci_core.h>
2834

29-
#include <zephyr/logging/log.h>
30-
#define LOG_MODULE_NAME bttester_gap
31-
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
32-
3335
#include "btp/btp.h"
3436

37+
#define LOG_MODULE_NAME bttester_gap
38+
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
3539
#define CONTROLLER_NAME "btp_tester"
3640

3741
#define BT_LE_AD_DISCOV_MASK (BT_LE_AD_LIMITED | BT_LE_AD_GENERAL)

tests/bluetooth/tester/src/btp_gatt.c

+13-8
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,34 @@
66
* SPDX-License-Identifier: Apache-2.0
77
*/
88

9-
#include <zephyr/types.h>
10-
#include <string.h>
119
#include <errno.h>
10+
#include <stdint.h>
1211
#include <stdlib.h>
12+
#include <string.h>
1313

14-
#include <zephyr/toolchain.h>
14+
#include <zephyr/autoconf.h>
15+
#include <zephyr/bluetooth/addr.h>
1516
#include <zephyr/bluetooth/att.h>
1617
#include <zephyr/bluetooth/bluetooth.h>
1718
#include <zephyr/bluetooth/conn.h>
1819
#include <zephyr/bluetooth/gatt.h>
1920
#include <zephyr/bluetooth/uuid.h>
2021
#include <zephyr/bluetooth/l2cap.h>
22+
#include <zephyr/kernel.h>
23+
#include <zephyr/logging/log.h>
24+
#include <zephyr/net_buf.h>
2125
#include <zephyr/sys/byteorder.h>
2226
#include <zephyr/sys/printk.h>
2327
#include <zephyr/sys/__assert.h>
24-
#include <zephyr/net_buf.h>
28+
#include <zephyr/sys/util.h>
29+
#include <zephyr/toolchain.h>
30+
#include <sys/types.h>
31+
32+
#include "btp/btp.h"
2533

26-
#include <zephyr/logging/log.h>
2734
#define LOG_MODULE_NAME bttester_gatt
2835
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
2936

30-
#include "btp/btp.h"
31-
3237
#define MAX_BUFFER_SIZE 2048
3338
#define MAX_UUID_LEN 16
3439

@@ -2063,7 +2068,7 @@ static uint8_t config_subscription_ind(const void *cmd, uint16_t cmd_len,
20632068
#if defined(CONFIG_BT_GATT_NOTIFY_MULTIPLE)
20642069
static void notify_cb(struct bt_conn *conn, void *user_data)
20652070
{
2066-
LOG_DBG("Nofication sent");
2071+
LOG_DBG("Notification sent");
20672072
}
20682073

20692074
static uint8_t notify_mult(const void *cmd, uint16_t cmd_len,

tests/bluetooth/tester/src/btp_ias.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
*
66
* SPDX-License-Identifier: Apache-2.0
77
*/
8+
#include <stdint.h>
9+
10+
#include <zephyr/autoconf.h>
811
#include <zephyr/bluetooth/services/ias.h>
12+
#include <zephyr/logging/log.h>
13+
#include <zephyr/sys/byteorder.h>
914

1015
#include "btp/btp.h"
11-
#include <zephyr/sys/byteorder.h>
12-
#include <stdint.h>
1316

14-
#include <zephyr/logging/log.h>
1517
#define LOG_MODULE_NAME bttester_ias
1618
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
1719

tests/bluetooth/tester/src/btp_l2cap.c

+15-6
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,29 @@
55
*
66
* SPDX-License-Identifier: Apache-2.0
77
*/
8+
#include <errno.h>
9+
#include <stddef.h>
10+
#include <stdint.h>
11+
#include <string.h>
812

13+
#include <zephyr/autoconf.h>
14+
#include <zephyr/bluetooth/addr.h>
15+
#include <zephyr/bluetooth/att.h>
916
#include <zephyr/bluetooth/bluetooth.h>
10-
11-
#include <errno.h>
17+
#include <zephyr/bluetooth/conn.h>
1218
#include <zephyr/bluetooth/l2cap.h>
13-
#include <zephyr/bluetooth/att.h>
19+
#include <zephyr/kernel.h>
20+
#include <zephyr/logging/log.h>
21+
#include <zephyr/net_buf.h>
1422
#include <zephyr/sys/byteorder.h>
23+
#include <zephyr/sys/util.h>
24+
#include <sys/types.h>
25+
26+
#include "btp/btp.h"
1527

16-
#include <zephyr/logging/log.h>
1728
#define LOG_MODULE_NAME bttester_l2cap
1829
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
1930

20-
#include "btp/btp.h"
21-
2231
#define L2CAP_MPS 96
2332
#define DATA_MTU (3 * L2CAP_MPS)
2433
#define DATA_MTU_INITIAL (2 * L2CAP_MPS)

tests/bluetooth/tester/src/btp_mesh.c

+25-12
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,41 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#include <zephyr/bluetooth/bluetooth.h>
8-
97
#include <assert.h>
108
#include <errno.h>
9+
#include <stdint.h>
10+
#include <string.h>
11+
#include <va.h>
12+
13+
#include <zephyr/autoconf.h>
14+
#include <zephyr/bluetooth/bluetooth.h>
1115
#include <zephyr/bluetooth/mesh.h>
16+
#include <zephyr/bluetooth/mesh/access.h>
1217
#include <zephyr/bluetooth/mesh/cfg.h>
13-
#include <zephyr/sys/byteorder.h>
18+
#include <zephyr/bluetooth/mesh/cfg_cli.h>
19+
#include <zephyr/bluetooth/mesh/cfg_srv.h>
20+
#include <zephyr/bluetooth/mesh/health_cli.h>
21+
#include <zephyr/bluetooth/mesh/health_srv.h>
22+
#include <zephyr/bluetooth/mesh/main.h>
23+
#include <zephyr/bluetooth/mesh/msg.h>
24+
#include <zephyr/bluetooth/mesh/proxy.h>
25+
#include <zephyr/logging/log.h>
26+
#include <zephyr/net_buf.h>
1427
#include <zephyr/settings/settings.h>
15-
#include <app_keys.h>
16-
#include <va.h>
17-
#include <sar_cfg_internal.h>
18-
#include <string.h>
28+
#include <zephyr/sys/byteorder.h>
29+
#include <zephyr/sys/util.h>
30+
#include <zephyr/sys/util_macro.h>
31+
#include <zephyr/sys_clock.h>
32+
1933
#include "mesh/access.h"
34+
#include "mesh/dfu_slot.h"
2035
#include "mesh/testing.h"
2136

22-
#include <zephyr/logging/log.h>
37+
#include "btp/btp.h"
38+
2339
#define LOG_MODULE_NAME bttester_mesh
2440
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
2541

26-
#include "btp/btp.h"
27-
#include "dfu_slot.h"
28-
2942
#define CID_LOCAL 0x05F1
3043
#define COMPANY_ID_LF 0x05F1
3144
#define COMPANY_ID_NORDIC_SEMI 0x05F9
@@ -1444,7 +1457,7 @@ static uint8_t start(const void *cmd, uint16_t cmd_len,
14441457
LOG_DBG("");
14451458

14461459
if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
1447-
printk("Loading stored settings\n");
1460+
LOG_INF("Loading stored settings\n");
14481461
settings_load();
14491462
}
14501463

0 commit comments

Comments
 (0)