Bluetooth: ISO: Split connected and broadcast ISO Kconfig
Add a new Kconfig option, BT_ISO_UNICAST, to make it possible either configure unicast only, broadcast only or both. This results in some code being moved, but not modified, and should not effect anything. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
cca1f3a45b
commit
a1cf45b26e
10 changed files with 658 additions and 643 deletions
|
|
@ -1,4 +1,4 @@
|
|||
CONFIG_BT=y
|
||||
CONFIG_BT_DEBUG_LOG=y
|
||||
CONFIG_BT_CENTRAL=y
|
||||
CONFIG_BT_ISO=y
|
||||
CONFIG_BT_ISO_UNICAST=y
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
CONFIG_BT=y
|
||||
CONFIG_BT_EXT_ADV=y
|
||||
CONFIG_BT_PER_ADV=y
|
||||
CONFIG_BT_ISO=y
|
||||
CONFIG_BT_ISO_BROADCAST=y
|
||||
CONFIG_BT_DEBUG_LOG=y
|
||||
CONFIG_BT_DEVICE_NAME="Test ISO Broadcaster"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
CONFIG_BT=y
|
||||
CONFIG_BT_OBSERVER=y
|
||||
CONFIG_BT_EXT_ADV=y
|
||||
CONFIG_BT_PER_ADV_SYNC=y
|
||||
CONFIG_BT_ISO=y
|
||||
CONFIG_BT_DEBUG_LOG=y
|
||||
CONFIG_BT_DEVICE_NAME="Test ISO Receive"
|
||||
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@ CONFIG_BT=y
|
|||
CONFIG_BT_DEBUG_LOG=y
|
||||
CONFIG_BT_PERIPHERAL=y
|
||||
CONFIG_BT_DEVICE_NAME="Zephyr ISO server"
|
||||
CONFIG_BT_ISO=y
|
||||
CONFIG_BT_ISO_UNICAST=y
|
||||
|
|
|
|||
|
|
@ -224,17 +224,34 @@ endif # BT_CONN
|
|||
|
||||
|
||||
config BT_ISO
|
||||
bool "Bluetooth Isochronous Channel Support [EXPERIMENTAL]"
|
||||
bool # hidden
|
||||
|
||||
config BT_ISO_UNICAST
|
||||
bool "Bluetooth Isochronous Channel Unicast Support [EXPERIMENTAL]"
|
||||
depends on BT_CONN
|
||||
select BT_ISO
|
||||
help
|
||||
Select this to enable Isochronous Channel support.
|
||||
This option enables support for Bluetooth Broadcast
|
||||
Isochronous channels.
|
||||
|
||||
# TODO: Split between broadcaster and observer for optimization
|
||||
config BT_ISO_BROADCAST
|
||||
bool "Bluetooth Isochronous Channel Broadcast Support [EXPERIMENTAL]"
|
||||
select BT_ISO
|
||||
select BT_EXT_ADV
|
||||
select BT_PER_ADV
|
||||
select BT_PER_ADV_SYNC
|
||||
help
|
||||
This option enables support for Bluetooth Broadcast
|
||||
Isochronous channels.
|
||||
|
||||
if BT_ISO
|
||||
|
||||
config BT_ISO_MAX_CHAN
|
||||
int "Maximum number of simultaneous ISO channels"
|
||||
depends on BT_ISO
|
||||
default BT_MAX_CONN
|
||||
default BT_MAX_CONN if BT_CONN
|
||||
default 1
|
||||
range 1 64
|
||||
help
|
||||
Maximum number of simultaneous Bluetooth isochronous channels
|
||||
|
|
@ -280,16 +297,6 @@ config BT_ISO_RX_MTU
|
|||
help
|
||||
Maximum MTU for Isochronous channels RX buffers.
|
||||
|
||||
# TODO: Split between broadcaster and observer for optimization
|
||||
config BT_ISO_BROADCAST
|
||||
bool "Bluetooth ISO Broadcast Channels supported"
|
||||
select BT_EXT_ADV
|
||||
select BT_PER_ADV
|
||||
select BT_PER_ADV_SYNC
|
||||
help
|
||||
This option enables support for Bluetooth Broadcast
|
||||
Isochronous channels.
|
||||
|
||||
if BT_ISO_BROADCAST
|
||||
|
||||
config BT_ISO_MAX_BIG
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ config BT_AUDIO_UNICAST
|
|||
bool "Bluetooth Unicast Audio Support"
|
||||
select BT_SMP
|
||||
select BT_L2CAP_DYNAMIC_CHANNEL
|
||||
select BT_ISO
|
||||
select BT_ISO_UNICAST
|
||||
select BT_GATT_DYNAMIC_DB
|
||||
select BT_GATT_CACHING
|
||||
select BT_L2CAP_ECRED
|
||||
|
|
@ -35,7 +35,6 @@ config BT_AUDIO_UNICAST
|
|||
# TODO: Make BT_AUDIO_BROADCAST not depend on BT_CONN
|
||||
config BT_AUDIO_BROADCAST
|
||||
bool "Bluetooth Broadcast Audio Support"
|
||||
select BT_ISO
|
||||
select BT_ISO_BROADCAST
|
||||
help
|
||||
This option enables support for Bluetooth Broadcast Audio using
|
||||
|
|
|
|||
|
|
@ -1880,7 +1880,8 @@ void bt_conn_unref(struct bt_conn *conn)
|
|||
/* Cleanup ISO before releasing the last reference to prevent other
|
||||
* threads reallocating the same connection while cleanup is ongoing.
|
||||
*/
|
||||
if (IS_ENABLED(CONFIG_BT_ISO) && conn->type == BT_CONN_TYPE_ISO &&
|
||||
if (IS_ENABLED(CONFIG_BT_ISO_UNICAST) &&
|
||||
conn->type == BT_CONN_TYPE_ISO &&
|
||||
atomic_get(&conn->ref) == 1) {
|
||||
bt_iso_cleanup(conn);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2187,11 +2187,12 @@ static const struct event_handler meta_events[] = {
|
|||
#endif /* CONFIG_BT_CONN */
|
||||
#endif /* defined(CONFIG_BT_PER_ADV_SYNC) */
|
||||
#endif /* defined(CONFIG_BT_EXT_ADV) */
|
||||
#if defined(CONFIG_BT_ISO)
|
||||
#if defined(CONFIG_BT_ISO_UNICAST)
|
||||
EVENT_HANDLER(BT_HCI_EVT_LE_CIS_ESTABLISHED, hci_le_cis_estabilished,
|
||||
sizeof(struct bt_hci_evt_le_cis_established)),
|
||||
EVENT_HANDLER(BT_HCI_EVT_LE_CIS_REQ, hci_le_cis_req,
|
||||
sizeof(struct bt_hci_evt_le_cis_req)),
|
||||
#endif /* (CONFIG_BT_ISO_UNICAST) */
|
||||
#if defined(CONFIG_BT_ISO_BROADCAST)
|
||||
EVENT_HANDLER(BT_HCI_EVT_LE_BIG_COMPLETE,
|
||||
hci_le_big_complete,
|
||||
|
|
@ -2209,7 +2210,6 @@ static const struct event_handler meta_events[] = {
|
|||
bt_hci_le_biginfo_adv_report,
|
||||
sizeof(struct bt_hci_evt_le_biginfo_adv_report)),
|
||||
#endif /* (CONFIG_BT_ISO_BROADCAST) */
|
||||
#endif /* (CONFIG_BT_ISO) */
|
||||
#if defined(CONFIG_BT_DF_CONNECTIONLESS_CTE_RX)
|
||||
EVENT_HANDLER(BT_HCI_EVT_LE_CONNECTIONLESS_IQ_REPORT, bt_hci_le_df_connectionless_iq_report,
|
||||
sizeof(struct bt_hci_evt_le_connectionless_iq_report)),
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -24,6 +24,8 @@
|
|||
|
||||
#include "bt.h"
|
||||
|
||||
#define DATA_MTU CONFIG_BT_ISO_TX_MTU
|
||||
|
||||
static void iso_recv(struct bt_iso_chan *chan, const struct bt_iso_recv_info *info,
|
||||
struct net_buf *buf)
|
||||
{
|
||||
|
|
@ -70,6 +72,9 @@ struct bt_iso_chan iso_chan = {
|
|||
.qos = &iso_qos,
|
||||
};
|
||||
|
||||
#if defined(CONFIG_BT_ISO_UNICAST)
|
||||
NET_BUF_POOL_FIXED_DEFINE(tx_pool, 1, DATA_MTU, NULL);
|
||||
|
||||
static int iso_accept(struct bt_conn *conn, struct bt_iso_chan **chan)
|
||||
{
|
||||
printk("Incoming conn %p\n", conn);
|
||||
|
|
@ -249,8 +254,6 @@ static int cmd_connect(const struct shell *shell, size_t argc, char *argv[])
|
|||
return 0;
|
||||
}
|
||||
|
||||
#define DATA_MTU CONFIG_BT_ISO_TX_MTU
|
||||
NET_BUF_POOL_FIXED_DEFINE(tx_pool, 1, DATA_MTU, NULL);
|
||||
|
||||
static int cmd_send(const struct shell *shell, size_t argc, char *argv[])
|
||||
{
|
||||
|
|
@ -308,6 +311,7 @@ static int cmd_disconnect(const struct shell *shell, size_t argc,
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_BT_ISO_UNICAST */
|
||||
|
||||
#if defined(CONFIG_BT_ISO_BROADCAST)
|
||||
#define BIS_ISO_CHAN_COUNT 1
|
||||
|
|
@ -493,6 +497,7 @@ static int cmd_big_term(const struct shell *shell, size_t argc, char *argv[])
|
|||
#endif /* CONFIG_BT_ISO_BROADCAST */
|
||||
|
||||
SHELL_STATIC_SUBCMD_SET_CREATE(iso_cmds,
|
||||
#if defined(CONFIG_BT_ISO_UNICAST)
|
||||
SHELL_CMD_ARG(bind, NULL, "[dir=tx,rx,txrx] [interval] [packing] [framing] "
|
||||
"[latency] [sdu] [phy] [rtn]", cmd_bind, 1, 8),
|
||||
SHELL_CMD_ARG(connect, NULL, "Connect ISO Channel", cmd_connect, 1, 0),
|
||||
|
|
@ -501,6 +506,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(iso_cmds,
|
|||
cmd_send, 1, 1),
|
||||
SHELL_CMD_ARG(disconnect, NULL, "Disconnect ISO Channel",
|
||||
cmd_disconnect, 1, 0),
|
||||
#endif /* CONFIG_BT_ISO_UNICAST */
|
||||
#if defined(CONFIG_BT_ISO_BROADCAST)
|
||||
SHELL_CMD_ARG(create-big, NULL, "Create a BIG as a broadcaster [enc <broadcast code>]",
|
||||
cmd_big_create, 1, 2),
|
||||
|
|
|
|||
Loading…
Reference in a new issue