tests: Bluetooth: tester: Improve BAP adv intervals
Modify the extended and periodic interval to be values that are more suited for audio as they are multiple of the expected resulting ISO interval. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
228b271f01
commit
2b93e6b40e
1 changed files with 16 additions and 6 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2023 Codecoup
|
* Copyright (c) 2023 Codecoup
|
||||||
|
* Copyright (c) 2024 Nordic Semiconductor ASA
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
@ -9,6 +10,7 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <zephyr/bluetooth/bluetooth.h>
|
||||||
#include <zephyr/types.h>
|
#include <zephyr/types.h>
|
||||||
#include <zephyr/kernel.h>
|
#include <zephyr/kernel.h>
|
||||||
#include <zephyr/sys/ring_buffer.h>
|
#include <zephyr/sys/ring_buffer.h>
|
||||||
|
@ -294,11 +296,21 @@ static int setup_broadcast_source(uint8_t streams_per_subgroup, uint8_t subgroup
|
||||||
uint8_t btp_bap_broadcast_source_setup(const void *cmd, uint16_t cmd_len,
|
uint8_t btp_bap_broadcast_source_setup(const void *cmd, uint16_t cmd_len,
|
||||||
void *rsp, uint16_t *rsp_len)
|
void *rsp, uint16_t *rsp_len)
|
||||||
{
|
{
|
||||||
|
struct bt_le_per_adv_param per_adv_param =
|
||||||
|
*BT_LE_PER_ADV_PARAM(BT_GAP_MS_TO_PER_ADV_INTERVAL(150),
|
||||||
|
BT_GAP_MS_TO_PER_ADV_INTERVAL(150), BT_LE_PER_ADV_OPT_NONE);
|
||||||
|
/* Zephyr Controller works best while Extended Advertising interval is a multiple
|
||||||
|
* of the ISO Interval minus 10 ms (max. advertising random delay). This is
|
||||||
|
* required to place the AUX_ADV_IND PDUs in a non-overlapping interval with the
|
||||||
|
* Broadcast ISO radio events.
|
||||||
|
*/
|
||||||
|
struct bt_le_adv_param ext_adv_param =
|
||||||
|
*BT_LE_ADV_PARAM(BT_LE_ADV_OPT_EXT_ADV, BT_GAP_MS_TO_ADV_INTERVAL(140),
|
||||||
|
BT_GAP_MS_TO_ADV_INTERVAL(140), NULL);
|
||||||
int err;
|
int err;
|
||||||
struct bt_audio_codec_cfg codec_cfg;
|
struct bt_audio_codec_cfg codec_cfg;
|
||||||
const struct btp_bap_broadcast_source_setup_cmd *cp = cmd;
|
const struct btp_bap_broadcast_source_setup_cmd *cp = cmd;
|
||||||
struct btp_bap_broadcast_source_setup_rp *rp = rsp;
|
struct btp_bap_broadcast_source_setup_rp *rp = rsp;
|
||||||
struct bt_le_adv_param param = *BT_LE_EXT_ADV_NCONN;
|
|
||||||
uint32_t broadcast_id;
|
uint32_t broadcast_id;
|
||||||
|
|
||||||
/* Only one local source/BIG supported for now */
|
/* Only one local source/BIG supported for now */
|
||||||
|
@ -356,17 +368,15 @@ uint8_t btp_bap_broadcast_source_setup(const void *cmd, uint16_t cmd_len,
|
||||||
base_ad[1].type = BT_DATA_NAME_COMPLETE;
|
base_ad[1].type = BT_DATA_NAME_COMPLETE;
|
||||||
base_ad[1].data_len = sizeof(CONFIG_BT_DEVICE_NAME) - 1;
|
base_ad[1].data_len = sizeof(CONFIG_BT_DEVICE_NAME) - 1;
|
||||||
base_ad[1].data = CONFIG_BT_DEVICE_NAME;
|
base_ad[1].data = CONFIG_BT_DEVICE_NAME;
|
||||||
err = tester_gap_create_adv_instance(¶m, BTP_GAP_ADDR_TYPE_IDENTITY, base_ad, 2, NULL,
|
err = tester_gap_create_adv_instance(&ext_adv_param, BTP_GAP_ADDR_TYPE_IDENTITY, base_ad, 2,
|
||||||
0, &gap_settings);
|
NULL, 0, &gap_settings);
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
LOG_DBG("Failed to create extended advertising instance: %d", err);
|
LOG_DBG("Failed to create extended advertising instance: %d", err);
|
||||||
|
|
||||||
return BTP_STATUS_FAILED;
|
return BTP_STATUS_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = tester_gap_padv_configure(BT_LE_PER_ADV_PARAM(BT_GAP_PER_ADV_FAST_INT_MIN_2,
|
err = tester_gap_padv_configure(&per_adv_param);
|
||||||
BT_GAP_PER_ADV_FAST_INT_MAX_2,
|
|
||||||
BT_LE_PER_ADV_OPT_NONE));
|
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
LOG_DBG("Failed to configure periodic advertising: %d", err);
|
LOG_DBG("Failed to configure periodic advertising: %d", err);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue