24
24
25
25
#include "bt.h"
26
26
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
+
27
33
#define TX_BUF_TIMEOUT K_SECONDS(1)
28
34
35
+ static struct bt_iso_chan_io_qos iso_tx_qos = DEFAULT_IO_QOS ;
29
36
static uint32_t cis_sn_last ;
30
37
static uint32_t bis_sn_last ;
31
38
static 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,
61
68
62
69
return (uint32_t )next_sn ;
63
70
}
71
+ #endif /* CONFIG_BT_ISO_TX */
64
72
73
+ #if defined(CONFIG_BT_ISO_RX )
65
74
static void iso_recv (struct bt_iso_chan * chan , const struct bt_iso_recv_info * info ,
66
75
struct net_buf * buf )
67
76
{
@@ -70,6 +79,7 @@ static void iso_recv(struct bt_iso_chan *chan, const struct bt_iso_recv_info *in
70
79
chan , buf -> len , info -> seq_num , info -> ts );
71
80
}
72
81
}
82
+ #endif /* CONFIG_BT_ISO_RX */
73
83
74
84
static void iso_connected (struct bt_iso_chan * chan )
75
85
{
@@ -85,13 +95,15 @@ static void iso_connected(struct bt_iso_chan *chan)
85
95
return ;
86
96
}
87
97
98
+ #if defined(CONFIG_BT_ISO_TX )
88
99
if (iso_info .type == BT_ISO_CHAN_TYPE_CONNECTED ) {
89
100
cis_sn_last = 0U ;
90
101
cis_sn_last_updated_ticks = k_uptime_ticks ();
91
102
} else {
92
103
bis_sn_last = 0U ;
93
104
bis_sn_last_updated_ticks = k_uptime_ticks ();
94
105
}
106
+ #endif /* CONFIG_BT_ISO_TX */
95
107
}
96
108
97
109
static 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)
101
113
}
102
114
103
115
static 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 ,
107
121
};
108
122
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
-
118
123
#if defined(CONFIG_BT_ISO_UNICAST )
119
124
static uint32_t cis_sdu_interval_us ;
120
125
@@ -935,7 +940,8 @@ static int cmd_big_term(const struct shell *sh, size_t argc, char *argv[])
935
940
SHELL_STATIC_SUBCMD_SET_CREATE (iso_cmds ,
936
941
#if defined(CONFIG_BT_ISO_UNICAST )
937
942
#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] "
939
945
"[packing] [framing] [C to P latency] [P to C latency] [sdu] [phy] [rtn]" ,
940
946
cmd_cig_create , 1 , 10 ),
941
947
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,
952
958
SHELL_CMD_ARG (listen , NULL , "<dir=tx,rx,txrx>" , cmd_listen , 2 , 0 ),
953
959
#endif /* CONFIG_BT_SMP */
954
960
#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 ),
959
965
SHELL_CMD_ARG (tx_sync_read_cis , NULL , "Read CIS TX sync info" , cmd_tx_sync_read_cis , 1 , 0 ),
960
966
#endif /* CONFIG_BT_ISO_UNICAST */
961
967
#if defined(CONFIG_BT_ISO_BROADCASTER )
@@ -965,8 +971,10 @@ SHELL_STATIC_SUBCMD_SET_CREATE(iso_cmds,
965
971
SHELL_CMD_ARG (tx_sync_read_bis , NULL , "Read BIS TX sync info" , cmd_tx_sync_read_bis , 1 , 0 ),
966
972
#endif /* CONFIG_BT_ISO_BROADCASTER */
967
973
#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 ),
970
978
#endif /* CONFIG_BT_ISO_SYNC_RECEIVER */
971
979
#if defined(CONFIG_BT_ISO_BROADCAST )
972
980
SHELL_CMD_ARG (term - big , NULL , "Terminate a BIG" , cmd_big_term , 1 , 0 ),
0 commit comments