Bluetooth: ISO: Rename BT_ISO_ADVANCED to BT_ISO_TEST_PARAMS
Rename the Kconfig option from BT_ISO_ADVANCED to BT_ISO_TEST_PARAMS to more explicitly denote that it enables support for using the ISO test parameters. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
697b44f013
commit
0521ffd5a3
6 changed files with 78 additions and 79 deletions
|
@ -22,14 +22,14 @@ LOG_MODULE_REGISTER(iso_broadcast_broadcaster, LOG_LEVEL_DBG);
|
|||
#define DEFAULT_BIS_PACKING 0
|
||||
#define DEFAULT_BIS_FRAMING 0
|
||||
#define DEFAULT_BIS_COUNT CONFIG_BT_ISO_MAX_CHAN
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
#define DEFAULT_BIS_NSE BT_ISO_NSE_MIN
|
||||
#define DEFAULT_BIS_BN BT_ISO_BN_MIN
|
||||
#define DEFAULT_BIS_PDU_SIZE CONFIG_BT_ISO_TX_MTU
|
||||
#define DEFAULT_BIS_IRC BT_ISO_IRC_MIN
|
||||
#define DEFAULT_BIS_PTO BT_ISO_PTO_MIN
|
||||
#define DEFAULT_BIS_ISO_INTERVAL DEFAULT_BIS_INTERVAL_US / 1250U /* N * 10 ms */
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
|
||||
NET_BUF_POOL_FIXED_DEFINE(bis_tx_pool, CONFIG_BT_ISO_TX_BUF_COUNT,
|
||||
BT_ISO_SDU_BUF_SIZE(CONFIG_BT_ISO_TX_MTU),
|
||||
|
@ -53,11 +53,11 @@ static struct bt_iso_big_create_param big_create_param = {
|
|||
.framing = DEFAULT_BIS_FRAMING, /* 0 - unframed, 1 - framed */
|
||||
.interval = DEFAULT_BIS_INTERVAL_US, /* in microseconds */
|
||||
.latency = DEFAULT_BIS_LATENCY_MS, /* milliseconds */
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
.irc = DEFAULT_BIS_IRC,
|
||||
.pto = DEFAULT_BIS_PTO,
|
||||
.iso_interval = DEFAULT_BIS_ISO_INTERVAL,
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
};
|
||||
|
||||
static void iso_connected(struct bt_iso_chan *chan)
|
||||
|
@ -91,17 +91,17 @@ static struct bt_iso_chan_io_qos iso_tx_qos = {
|
|||
.sdu = DEFAULT_BIS_SDU, /* bytes */
|
||||
.rtn = DEFAULT_BIS_RTN,
|
||||
.phy = DEFAULT_BIS_PHY,
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
.max_pdu = DEFAULT_BIS_PDU_SIZE,
|
||||
.burst_number = DEFAULT_BIS_BN,
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
};
|
||||
|
||||
static struct bt_iso_chan_qos bis_iso_qos = {
|
||||
.tx = &iso_tx_qos,
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
.num_subevents = DEFAULT_BIS_NSE,
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
};
|
||||
|
||||
static size_t get_chars(char *buffer, size_t max_size)
|
||||
|
@ -241,7 +241,7 @@ static int parse_sdu_arg(void)
|
|||
return (int)sdu;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
static int parse_irc_arg(void)
|
||||
{
|
||||
size_t char_count;
|
||||
|
@ -385,7 +385,7 @@ static int parse_bn_arg(void)
|
|||
|
||||
return (int)burst_number;
|
||||
}
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
|
||||
static int parse_packing_arg(void)
|
||||
{
|
||||
|
@ -468,14 +468,14 @@ static int parse_args(void)
|
|||
int packing;
|
||||
int framing;
|
||||
int bis_count;
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
int num_subevents;
|
||||
int iso_interval;
|
||||
int burst_number;
|
||||
int max_pdu;
|
||||
int irc;
|
||||
int pto;
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
|
||||
printk("Follow the prompts. Press enter to use default values.\n");
|
||||
|
||||
|
@ -519,7 +519,7 @@ static int parse_args(void)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
irc = parse_irc_arg();
|
||||
if (irc < 0) {
|
||||
return -EINVAL;
|
||||
|
@ -549,7 +549,7 @@ static int parse_args(void)
|
|||
if (burst_number < 0) {
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
|
||||
iso_tx_qos.rtn = rtn;
|
||||
iso_tx_qos.phy = phy;
|
||||
|
@ -559,14 +559,14 @@ static int parse_args(void)
|
|||
big_create_param.packing = packing;
|
||||
big_create_param.framing = framing;
|
||||
big_create_param.num_bis = bis_count;
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
bis_iso_qos.num_subevents = num_subevents;
|
||||
iso_tx_qos.max_pdu = max_pdu;
|
||||
iso_tx_qos.burst_number = burst_number;
|
||||
big_create_param.irc = irc;
|
||||
big_create_param.pto = pto;
|
||||
big_create_param.iso_interval = iso_interval;
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -38,13 +38,13 @@ enum benchmark_role {
|
|||
#define DEFAULT_CIS_COUNT 1U
|
||||
#define DEFAULT_CIS_SEC_LEVEL BT_SECURITY_L1
|
||||
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
#define DEFAULT_CIS_NSE BT_ISO_NSE_MIN
|
||||
#define DEFAULT_CIS_BN BT_ISO_BN_MIN
|
||||
#define DEFAULT_CIS_PDU_SIZE CONFIG_BT_ISO_TX_MTU
|
||||
#define DEFAULT_CIS_FT BT_ISO_FT_MIN
|
||||
#define DEFAULT_CIS_ISO_INTERVAL DEFAULT_CIS_INTERVAL_US / 1250U /* N * 1.25 ms */
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
|
||||
#define BUFFERS_ENQUEUED 2 /* Number of buffers enqueue for each channel */
|
||||
|
||||
|
@ -91,28 +91,28 @@ static struct bt_iso_chan_io_qos iso_tx_qos = {
|
|||
.sdu = DEFAULT_CIS_SDU_SIZE, /* bytes */
|
||||
.rtn = DEFAULT_CIS_RTN,
|
||||
.phy = DEFAULT_CIS_PHY,
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
.max_pdu = DEFAULT_CIS_PDU_SIZE,
|
||||
.burst_number = DEFAULT_CIS_BN,
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
};
|
||||
|
||||
static struct bt_iso_chan_io_qos iso_rx_qos = {
|
||||
.sdu = DEFAULT_CIS_SDU_SIZE, /* bytes */
|
||||
.rtn = DEFAULT_CIS_RTN,
|
||||
.phy = DEFAULT_CIS_PHY,
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
.max_pdu = DEFAULT_CIS_PDU_SIZE,
|
||||
.burst_number = DEFAULT_CIS_BN,
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
};
|
||||
|
||||
static struct bt_iso_chan_qos iso_qos = {
|
||||
.tx = &iso_tx_qos,
|
||||
.rx = &iso_rx_qos,
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
.num_subevents = DEFAULT_CIS_NSE,
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
};
|
||||
|
||||
static struct bt_iso_cig_param cig_create_param = {
|
||||
|
@ -123,11 +123,11 @@ static struct bt_iso_cig_param cig_create_param = {
|
|||
.framing = DEFAULT_CIS_FRAMING,
|
||||
.cis_channels = cis,
|
||||
.num_cis = DEFAULT_CIS_COUNT,
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
.c_to_p_ft = DEFAULT_CIS_FT,
|
||||
.p_to_c_ft = DEFAULT_CIS_FT,
|
||||
.iso_interval = DEFAULT_CIS_ISO_INTERVAL,
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
};
|
||||
|
||||
static enum benchmark_role device_role_select(void)
|
||||
|
@ -632,7 +632,7 @@ static int parse_sdu_arg(struct bt_iso_chan_io_qos *qos)
|
|||
return (int)sdu;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
static int parse_c_to_p_ft_arg(void)
|
||||
{
|
||||
char buffer[4];
|
||||
|
@ -778,7 +778,7 @@ static int parse_bn_arg(const struct bt_iso_chan_io_qos *qos)
|
|||
|
||||
return (int)bn;
|
||||
}
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
|
||||
static int parse_cis_count_arg(void)
|
||||
{
|
||||
|
@ -808,12 +808,12 @@ static int parse_cig_args(void)
|
|||
int interval;
|
||||
int latency;
|
||||
int cis_count;
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
int c_to_p_ft;
|
||||
int p_to_c_ft;
|
||||
int iso_interval;
|
||||
int num_subevents;
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
|
||||
printk("Follow the prompts. Press enter to use default values.\n");
|
||||
|
||||
|
@ -832,7 +832,7 @@ static int parse_cig_args(void)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
c_to_p_ft = parse_c_to_p_ft_arg();
|
||||
if (c_to_p_ft < 0) {
|
||||
return -EINVAL;
|
||||
|
@ -852,17 +852,17 @@ static int parse_cig_args(void)
|
|||
if (num_subevents < 0) {
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
|
||||
cig_create_param.interval = interval;
|
||||
cig_create_param.latency = latency;
|
||||
cig_create_param.num_cis = cis_count;
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
cig_create_param.c_to_p_ft = c_to_p_ft;
|
||||
cig_create_param.p_to_c_ft = p_to_c_ft;
|
||||
cig_create_param.iso_interval = iso_interval;
|
||||
iso_qos.num_subevents = num_subevents;
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -872,10 +872,10 @@ static int parse_cis_args(struct bt_iso_chan_io_qos *qos)
|
|||
int rtn;
|
||||
int phy;
|
||||
int sdu;
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
int max_pdu;
|
||||
int burst_number;
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
|
||||
printk("Follow the prompts. Press enter to use default values.\n");
|
||||
|
||||
|
@ -894,7 +894,7 @@ static int parse_cis_args(struct bt_iso_chan_io_qos *qos)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
max_pdu = parse_pdu_arg(qos);
|
||||
if (max_pdu < 0) {
|
||||
return -EINVAL;
|
||||
|
@ -904,15 +904,15 @@ static int parse_cis_args(struct bt_iso_chan_io_qos *qos)
|
|||
if (burst_number < 0) {
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
|
||||
qos->rtn = rtn;
|
||||
qos->phy = phy;
|
||||
qos->sdu = sdu;
|
||||
#if defined(CONFIG_BT_ISO_ADVANCED)
|
||||
#if defined(CONFIG_BT_ISO_TEST_PARAMS)
|
||||
qos->max_pdu = max_pdu;
|
||||
qos->burst_number = burst_number;
|
||||
#endif /* CONFIG_BT_ISO_ADVANCED */
|
||||
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue