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 <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2025-04-11 15:30:02 +02:00 committed by Benjamin Cabé
commit 72d9a37159
18 changed files with 140 additions and 86 deletions

View file

@ -6,19 +6,27 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/kernel.h>
#include <errno.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <zephyr/types.h>
#include <zephyr/autoconf.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/device.h>
#include <zephyr/drivers/uart.h>
#include <zephyr/toolchain.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/drivers/uart_pipe.h>
#include <zephyr/kernel.h>
#include <zephyr/kernel/thread_stack.h>
#include <zephyr/logging/log.h>
#include <zephyr/net_buf.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys_clock.h>
#include <zephyr/toolchain.h>
#include <zephyr/types.h>
#define LOG_MODULE_NAME bttester
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);

View file

@ -10,8 +10,7 @@
#ifndef TESTS_BLUETOOTH_TESTER_SRC_BTP_
#define TESTS_BLUETOOTH_TESTER_SRC_BTP_
#include <zephyr/sys/util.h>
#include <zephyr/bluetooth/addr.h>
#include <stdint.h>
#include "bttester.h"
#include "btp_core.h"

View file

@ -7,8 +7,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/sys/util.h>
#include <zephyr/bluetooth/addr.h>
#include <stdint.h>
/* Core Service */
#define BTP_CORE_READ_SUPPORTED_COMMANDS 0x01

View file

@ -7,7 +7,9 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/sys/util.h>
#include <stddef.h>
#include <stdint.h>
#include <zephyr/bluetooth/addr.h>
/* GAP Service */

View file

@ -7,7 +7,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/sys/util.h>
#include <stdint.h>
#include <zephyr/bluetooth/addr.h>
/* GATT Service */

View file

@ -6,7 +6,6 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/bluetooth/services/ias.h>
#include <stdint.h>
/* events */

View file

@ -7,7 +7,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/sys/util.h>
#include <stdint.h>
#include <zephyr/bluetooth/addr.h>
/* L2CAP Service */

View file

@ -7,8 +7,10 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/sys/util.h>
#include <stdint.h>
#include <zephyr/bluetooth/addr.h>
#include <zephyr/sys/util_macro.h>
/* MESH Service */
/* commands */

View file

@ -6,6 +6,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>
/* OTS commands */
#define BTP_OTS_READ_SUPPORTED_COMMANDS 0x01
struct btp_ots_read_supported_commands_rp {

View file

@ -7,9 +7,11 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/types.h>
#include <zephyr/sys/util.h>
#include <stddef.h>
#include <stdint.h>
#include <zephyr/bluetooth/addr.h>
#include <zephyr/sys/util_macro.h>
#include <sys/types.h>
static inline void tester_set_bit(uint8_t *addr, unsigned int bit)

View file

@ -7,26 +7,25 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/sys/atomic.h>
#include <zephyr/types.h>
#include <string.h>
#include <stdint.h>
#include <zephyr/toolchain.h>
#include <zephyr/autoconf.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/gatt.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/net_buf.h>
#include <hci_core.h>
#include <zephyr/logging/log.h>
#define LOG_MODULE_NAME bttester_core
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
#include <zephyr/net_buf.h>
#include <zephyr/sys/atomic.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/util.h>
#include <zephyr/toolchain.h>
#include "btp/btp.h"
#include "hci_core.h"
#define LOG_MODULE_NAME bttester_core
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
static ATOMIC_DEFINE(registered_services, BTP_SERVICE_ID_MAX);

View file

@ -5,33 +5,37 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <errno.h>
#include <stdint.h>
#include <zephyr/bluetooth/audio/bap.h>
#include <zephyr/bluetooth/addr.h>
#include <zephyr/bluetooth/gap.h>
#include <zephyr/sys/atomic.h>
#include <zephyr/sys/util_macro.h>
#include <zephyr/types.h>
#include <string.h>
#include <zephyr/toolchain.h>
#include <zephyr/autoconf.h>
#include <zephyr/bluetooth/addr.h>
#include <zephyr/bluetooth/att.h>
#include <zephyr/bluetooth/audio/bap.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/gatt.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/gap.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/bluetooth/uuid.h>
#include <zephyr/logging/log.h>
#include <zephyr/sys/atomic.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys/util_macro.h>
#include <zephyr/toolchain.h>
#include <zephyr/types.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/net_buf.h>
#include <hci_core.h>
#include <zephyr/logging/log.h>
#define LOG_MODULE_NAME bttester_gap
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
#include "btp/btp.h"
#define LOG_MODULE_NAME bttester_gap
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
#define CONTROLLER_NAME "btp_tester"
#define BT_LE_AD_DISCOV_MASK (BT_LE_AD_LIMITED | BT_LE_AD_GENERAL)

View file

@ -6,29 +6,34 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/types.h>
#include <string.h>
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <zephyr/toolchain.h>
#include <zephyr/autoconf.h>
#include <zephyr/bluetooth/addr.h>
#include <zephyr/bluetooth/att.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/gatt.h>
#include <zephyr/bluetooth/uuid.h>
#include <zephyr/bluetooth/l2cap.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/net_buf.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/printk.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/net_buf.h>
#include <zephyr/logging/log.h>
#define LOG_MODULE_NAME bttester_gatt
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
#include <zephyr/sys/util.h>
#include <zephyr/toolchain.h>
#include <sys/types.h>
#include "btp/btp.h"
#define LOG_MODULE_NAME bttester_gatt
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
#define MAX_BUFFER_SIZE 2048
#define MAX_UUID_LEN 16
@ -2063,7 +2068,7 @@ static uint8_t config_subscription_ind(const void *cmd, uint16_t cmd_len,
#if defined(CONFIG_BT_GATT_NOTIFY_MULTIPLE)
static void notify_cb(struct bt_conn *conn, void *user_data)
{
LOG_DBG("Nofication sent");
LOG_DBG("Notification sent");
}
static uint8_t notify_mult(const void *cmd, uint16_t cmd_len,

View file

@ -5,13 +5,15 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/bluetooth/services/ias.h>
#include "btp/btp.h"
#include <zephyr/sys/byteorder.h>
#include <stdint.h>
#include <zephyr/autoconf.h>
#include <zephyr/bluetooth/services/ias.h>
#include <zephyr/logging/log.h>
#include <zephyr/sys/byteorder.h>
#include "btp/btp.h"
#define LOG_MODULE_NAME bttester_ias
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);

View file

@ -5,20 +5,29 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/bluetooth/bluetooth.h>
#include <errno.h>
#include <zephyr/bluetooth/l2cap.h>
#include <zephyr/bluetooth/att.h>
#include <zephyr/sys/byteorder.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <zephyr/autoconf.h>
#include <zephyr/bluetooth/addr.h>
#include <zephyr/bluetooth/att.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/l2cap.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#define LOG_MODULE_NAME bttester_l2cap
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
#include <zephyr/net_buf.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/util.h>
#include <sys/types.h>
#include "btp/btp.h"
#define LOG_MODULE_NAME bttester_l2cap
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
#define L2CAP_MPS 96
#define DATA_MTU (3 * L2CAP_MPS)
#define DATA_MTU_INITIAL (2 * L2CAP_MPS)

View file

@ -4,28 +4,41 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/bluetooth/bluetooth.h>
#include <assert.h>
#include <errno.h>
#include <zephyr/bluetooth/mesh.h>
#include <zephyr/bluetooth/mesh/cfg.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/settings/settings.h>
#include <app_keys.h>
#include <va.h>
#include <sar_cfg_internal.h>
#include <stdint.h>
#include <string.h>
#include <va.h>
#include <zephyr/autoconf.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/mesh.h>
#include <zephyr/bluetooth/mesh/access.h>
#include <zephyr/bluetooth/mesh/cfg.h>
#include <zephyr/bluetooth/mesh/cfg_cli.h>
#include <zephyr/bluetooth/mesh/cfg_srv.h>
#include <zephyr/bluetooth/mesh/health_cli.h>
#include <zephyr/bluetooth/mesh/health_srv.h>
#include <zephyr/bluetooth/mesh/main.h>
#include <zephyr/bluetooth/mesh/msg.h>
#include <zephyr/bluetooth/mesh/proxy.h>
#include <zephyr/logging/log.h>
#include <zephyr/net_buf.h>
#include <zephyr/settings/settings.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys/util_macro.h>
#include <zephyr/sys_clock.h>
#include "mesh/access.h"
#include "mesh/dfu_slot.h"
#include "mesh/testing.h"
#include <zephyr/logging/log.h>
#include "btp/btp.h"
#define LOG_MODULE_NAME bttester_mesh
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
#include "btp/btp.h"
#include "dfu_slot.h"
#define CID_LOCAL 0x05F1
#define COMPANY_ID_LF 0x05F1
#define COMPANY_ID_NORDIC_SEMI 0x05F9
@ -1444,7 +1457,7 @@ static uint8_t start(const void *cmd, uint16_t cmd_len,
LOG_DBG("");
if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
printk("Loading stored settings\n");
LOG_INF("Loading stored settings\n");
settings_load();
}

View file

@ -5,17 +5,26 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <errno.h>
#include <inttypes.h>
#include <stdint.h>
#include <string.h>
#include <zephyr/autoconf.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/services/ots.h>
#include <zephyr/bluetooth/uuid.h>
#include <zephyr/logging/log.h>
#include <zephyr/sys/byteorder.h>
#include <stdint.h>
#include <zephyr/logging/log.h>
#define LOG_MODULE_NAME bttester_ots
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
#include <zephyr/sys/util.h>
#include <sys/types.h>
#include "btp/btp.h"
#define LOG_MODULE_NAME bttester_ots
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
#define OBJ_POOL_SIZE CONFIG_BT_OTS_MAX_OBJ_CNT
#define OBJ_MAX_SIZE 100

View file

@ -6,11 +6,9 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/kernel.h>
#include <zephyr/types.h>
#include <zephyr/toolchain.h>
#include <zephyr/autoconf.h>
#include <zephyr/logging/log.h>
#define LOG_MODULE_NAME bttester_main
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);