2424
2525#include "bt.h"
2626
27+ #if defined(CONFIG_BT_ISO_TX )
28+ #define DEFAULT_IO_QOS \
29+ { \
30+ .sdu = 40u, .phy = BT_GAP_LE_PHY_2M, .rtn = 2u, \
31+ }
32+
2733#define TX_BUF_TIMEOUT K_SECONDS(1)
2834
35+ static struct bt_iso_chan_io_qos iso_tx_qos = DEFAULT_IO_QOS ;
2936static uint32_t cis_sn_last ;
3037static uint32_t bis_sn_last ;
3138static int64_t cis_sn_last_updated_ticks ;
@@ -61,7 +68,9 @@ static uint32_t get_next_sn(uint32_t last_sn, int64_t *last_ticks,
6168
6269 return (uint32_t )next_sn ;
6370}
71+ #endif /* CONFIG_BT_ISO_TX */
6472
73+ #if defined(CONFIG_BT_ISO_RX )
6574static void iso_recv (struct bt_iso_chan * chan , const struct bt_iso_recv_info * info ,
6675 struct net_buf * buf )
6776{
@@ -70,6 +79,7 @@ static void iso_recv(struct bt_iso_chan *chan, const struct bt_iso_recv_info *in
7079 chan , buf -> len , info -> seq_num , info -> ts );
7180 }
7281}
82+ #endif /* CONFIG_BT_ISO_RX */
7383
7484static void iso_connected (struct bt_iso_chan * chan )
7585{
@@ -85,13 +95,15 @@ static void iso_connected(struct bt_iso_chan *chan)
8595 return ;
8696 }
8797
98+ #if defined(CONFIG_BT_ISO_TX )
8899 if (iso_info .type == BT_ISO_CHAN_TYPE_CONNECTED ) {
89100 cis_sn_last = 0U ;
90101 cis_sn_last_updated_ticks = k_uptime_ticks ();
91102 } else {
92103 bis_sn_last = 0U ;
93104 bis_sn_last_updated_ticks = k_uptime_ticks ();
94105 }
106+ #endif /* CONFIG_BT_ISO_TX */
95107}
96108
97109static void iso_disconnected (struct bt_iso_chan * chan , uint8_t reason )
@@ -101,20 +113,13 @@ static void iso_disconnected(struct bt_iso_chan *chan, uint8_t reason)
101113}
102114
103115static struct bt_iso_chan_ops iso_ops = {
104- .recv = iso_recv ,
105- .connected = iso_connected ,
106- .disconnected = iso_disconnected ,
116+ #if defined(CONFIG_BT_ISO_RX )
117+ .recv = iso_recv ,
118+ #endif /* CONFIG_BT_ISO_RX */
119+ .connected = iso_connected ,
120+ .disconnected = iso_disconnected ,
107121};
108122
109- #define DEFAULT_IO_QOS \
110- { \
111- .sdu = 40u, \
112- .phy = BT_GAP_LE_PHY_2M, \
113- .rtn = 2u, \
114- }
115-
116- static struct bt_iso_chan_io_qos iso_tx_qos = DEFAULT_IO_QOS ;
117-
118123#if defined(CONFIG_BT_ISO_UNICAST )
119124static uint32_t cis_sdu_interval_us ;
120125
@@ -935,7 +940,8 @@ static int cmd_big_term(const struct shell *sh, size_t argc, char *argv[])
935940SHELL_STATIC_SUBCMD_SET_CREATE (iso_cmds ,
936941#if defined(CONFIG_BT_ISO_UNICAST )
937942#if defined(CONFIG_BT_ISO_CENTRAL )
938- SHELL_CMD_ARG (cig_create , NULL , "[dir=tx,rx,txrx] [C to P interval] [P to C interval] "
943+ SHELL_CMD_ARG (cig_create , NULL ,
944+ "[dir=tx,rx,txrx] [C to P interval] [P to C interval] "
939945 "[packing] [framing] [C to P latency] [P to C latency] [sdu] [phy] [rtn]" ,
940946 cmd_cig_create , 1 , 10 ),
941947 SHELL_CMD_ARG (cig_term , NULL , "Terminate the CIG" , cmd_cig_term , 1 , 0 ),
@@ -952,10 +958,10 @@ SHELL_STATIC_SUBCMD_SET_CREATE(iso_cmds,
952958 SHELL_CMD_ARG (listen , NULL , "<dir=tx,rx,txrx>" , cmd_listen , 2 , 0 ),
953959#endif /* CONFIG_BT_SMP */
954960#endif /* CONFIG_BT_ISO_PERIPHERAL */
955- SHELL_CMD_ARG ( send , NULL , "Send to ISO Channel [count]" ,
956- cmd_send , 1 , 1 ),
957- SHELL_CMD_ARG ( disconnect , NULL , "Disconnect ISO Channel" ,
958- cmd_disconnect , 1 , 0 ),
961+ #if defined( CONFIG_BT_ISO_TX )
962+ SHELL_CMD_ARG ( send , NULL , "Send to ISO Channel [count]" , cmd_send , 1 , 1 ),
963+ #endif /* CONFIG_BT_ISO_TX */
964+ SHELL_CMD_ARG ( disconnect , NULL , "Disconnect ISO Channel" , cmd_disconnect , 1 , 0 ),
959965 SHELL_CMD_ARG (tx_sync_read_cis , NULL , "Read CIS TX sync info" , cmd_tx_sync_read_cis , 1 , 0 ),
960966#endif /* CONFIG_BT_ISO_UNICAST */
961967#if defined(CONFIG_BT_ISO_BROADCASTER )
@@ -965,8 +971,10 @@ SHELL_STATIC_SUBCMD_SET_CREATE(iso_cmds,
965971 SHELL_CMD_ARG (tx_sync_read_bis , NULL , "Read BIS TX sync info" , cmd_tx_sync_read_bis , 1 , 0 ),
966972#endif /* CONFIG_BT_ISO_BROADCASTER */
967973#if defined(CONFIG_BT_ISO_SYNC_RECEIVER )
968- SHELL_CMD_ARG (sync - big , NULL , "Synchronize to a BIG as a receiver <BIS bitfield> [mse] "
969- "[timeout] [enc <broadcast code>]" , cmd_big_sync , 2 , 4 ),
974+ SHELL_CMD_ARG (sync - big , NULL ,
975+ "Synchronize to a BIG as a receiver <BIS bitfield> [mse] "
976+ "[timeout] [enc <broadcast code>]" ,
977+ cmd_big_sync , 2 , 4 ),
970978#endif /* CONFIG_BT_ISO_SYNC_RECEIVER */
971979#if defined(CONFIG_BT_ISO_BROADCAST )
972980 SHELL_CMD_ARG (term - big , NULL , "Terminate a BIG" , cmd_big_term , 1 , 0 ),
0 commit comments