Skip to content

tests: Bluetooth: Tester: Cleanup includes #88500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions subsys/bluetooth/mesh/va.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <stdint.h>
#include <stdbool.h>

/** Virtual address entry. */
struct bt_mesh_va {
uint16_t ref:15,
Expand Down
22 changes: 15 additions & 7 deletions tests/bluetooth/tester/src/btp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 1 addition & 2 deletions tests/bluetooth/tester/src/btp/btp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions tests/bluetooth/tester/src/btp/btp_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tests/bluetooth/tester/src/btp/btp_gap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
3 changes: 2 additions & 1 deletion tests/bluetooth/tester/src/btp/btp_gatt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 0 additions & 1 deletion tests/bluetooth/tester/src/btp/btp_ias.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/bluetooth/services/ias.h>
#include <stdint.h>

/* events */
Expand Down
3 changes: 2 additions & 1 deletion tests/bluetooth/tester/src/btp/btp_l2cap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 3 additions & 1 deletion tests/bluetooth/tester/src/btp/btp_mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 2 additions & 0 deletions tests/bluetooth/tester/src/btp/btp_ots.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 4 additions & 2 deletions tests/bluetooth/tester/src/btp/bttester.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
19 changes: 9 additions & 10 deletions tests/bluetooth/tester/src/btp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,26 @@
* 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/logging/log.h>
#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 <hci_core.h>
#include "btp/btp.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 "btp/btp.h"

static ATOMIC_DEFINE(registered_services, BTP_SERVICE_ID_MAX);

static uint8_t supported_commands(const void *cmd, uint16_t cmd_len,
Expand Down
28 changes: 16 additions & 12 deletions tests/bluetooth/tester/src/btp_gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 13 additions & 8 deletions tests/bluetooth/tester/src/btp_gatt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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/sys/util.h>
#include <zephyr/toolchain.h>
#include <sys/types.h>

#include "btp/btp.h"

#include <zephyr/logging/log.h>
#define LOG_MODULE_NAME bttester_gatt
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);

#include "btp/btp.h"

#define MAX_BUFFER_SIZE 2048
#define MAX_UUID_LEN 16

Expand Down Expand Up @@ -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,
Expand Down
8 changes: 5 additions & 3 deletions tests/bluetooth/tester/src/btp_ias.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
#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"
#include <zephyr/sys/byteorder.h>
#include <stdint.h>

#include <zephyr/logging/log.h>
#define LOG_MODULE_NAME bttester_ias
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);

Expand Down
21 changes: 15 additions & 6 deletions tests/bluetooth/tester/src/btp_l2cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,29 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <errno.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 <errno.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/l2cap.h>
#include <zephyr/bluetooth/att.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/net_buf.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/util.h>
#include <sys/types.h>

#include "btp/btp.h"

#include <zephyr/logging/log.h>
#define LOG_MODULE_NAME bttester_l2cap
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);

#include "btp/btp.h"

#define L2CAP_MPS 96
#define DATA_MTU (3 * L2CAP_MPS)
#define DATA_MTU_INITIAL (2 * L2CAP_MPS)
Expand Down
37 changes: 25 additions & 12 deletions tests/bluetooth/tester/src/btp_mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,41 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/bluetooth/bluetooth.h>

#include <assert.h>
#include <errno.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/sys/byteorder.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 <app_keys.h>
#include <va.h>
#include <sar_cfg_internal.h>
#include <string.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
Expand Down Expand Up @@ -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();
}

Expand Down
Loading