@@ -61,10 +61,7 @@ static struct bt_codec_qos broadcast_source_qos;
61
61
static struct bt_bap_stream broadcast_sink_streams [BROADCAST_SNK_STREAM_CNT ];
62
62
static struct bt_bap_broadcast_sink * default_sink ;
63
63
#endif /* CONFIG_BT_BAP_BROADCAST_SINK */
64
- static struct bt_bap_stream * txing_stream ;
65
64
static struct bt_bap_stream * default_stream ;
66
- static uint16_t seq_num ;
67
- static size_t rx_cnt ;
68
65
69
66
static const struct named_lc3_preset lc3_unicast_presets [] = {
70
67
{"8_1_1" , BT_BAP_LC3_UNICAST_PRESET_8_1_1 (LOCATION , CONTEXT )},
@@ -144,6 +141,10 @@ const struct named_lc3_preset *default_source_preset = &lc3_unicast_presets[3];
144
141
static const struct named_lc3_preset * default_broadcast_source_preset = & lc3_broadcast_presets [3 ];
145
142
static bool initialized ;
146
143
144
+ #if defined(CONFIG_BT_AUDIO_TX )
145
+ static struct bt_bap_stream * txing_stream ;
146
+ static uint16_t seq_num ;
147
+
147
148
static uint16_t get_next_seq_num (uint32_t interval_us )
148
149
{
149
150
static int64_t last_ticks ;
@@ -165,8 +166,9 @@ static uint16_t get_next_seq_num(uint32_t interval_us)
165
166
166
167
return (uint16_t )next_seq_num ;
167
168
}
169
+ #endif /* CONFIG_BT_AUDIO_TX */
168
170
169
- #if defined(CONFIG_LIBLC3 )
171
+ #if defined(CONFIG_LIBLC3 ) && defined( CONFIG_BT_AUDIO_TX )
170
172
NET_BUF_POOL_FIXED_DEFINE (sine_tx_pool , CONFIG_BT_ISO_TX_BUF_COUNT ,
171
173
CONFIG_BT_ISO_TX_MTU + BT_ISO_CHAN_SEND_RESERVE ,
172
174
8 , NULL );
@@ -363,7 +365,7 @@ static void lc3_audio_timer_timeout(struct k_work *work)
363
365
}
364
366
365
367
static K_WORK_DELAYABLE_DEFINE (audio_send_work , lc3_audio_timer_timeout ) ;
366
- #endif /* CONFIG_LIBLC3 */
368
+ #endif /* CONFIG_LIBLC3 && CONFIG_BT_AUDIO_TX */
367
369
368
370
static void print_codec (const struct bt_codec * codec )
369
371
{
@@ -534,7 +536,9 @@ static int lc3_start(struct bt_bap_stream *stream, struct bt_bap_ascs_rsp *rsp)
534
536
{
535
537
shell_print (ctx_shell , "Start: stream %p" , stream );
536
538
539
+ #if defined(CONFIG_BT_AUDIO_TX )
537
540
seq_num = 0 ;
541
+ #endif /* CONFIG_BT_AUDIO_TX */
538
542
539
543
return 0 ;
540
544
}
@@ -1725,6 +1729,7 @@ static void audio_recv(struct bt_bap_stream *stream,
1725
1729
struct net_buf * buf )
1726
1730
{
1727
1731
static struct bt_iso_recv_info last_info ;
1732
+ static size_t rx_cnt ;
1728
1733
1729
1734
/* TODO: Make it possible to only print every X packets, and make X settable by the shell */
1730
1735
if ((rx_cnt % 100 ) == 0 ) {
@@ -2380,6 +2385,7 @@ static int cmd_init(const struct shell *sh, size_t argc, char *argv[])
2380
2385
return 0 ;
2381
2386
}
2382
2387
2388
+ #if defined(CONFIG_BT_AUDIO_TX )
2383
2389
#define DATA_MTU CONFIG_BT_ISO_TX_MTU
2384
2390
NET_BUF_POOL_FIXED_DEFINE (tx_pool , 1 , DATA_MTU , 8 , NULL );
2385
2391
@@ -2486,6 +2492,7 @@ static int cmd_stop_sine(const struct shell *sh, size_t argc, char *argv[])
2486
2492
return 0 ;
2487
2493
}
2488
2494
#endif /* CONFIG_LIBLC3 */
2495
+ #endif /* CONFIG_BT_AUDIO_TX */
2489
2496
2490
2497
#if defined(CONFIG_BT_BAP_UNICAST_SERVER )
2491
2498
static void print_ase_info (struct bt_bap_ep * ep , void * user_data )
@@ -2550,16 +2557,17 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
2550
2557
SHELL_CMD_ARG (start , NULL , NULL , cmd_start , 1 , 0 ),
2551
2558
SHELL_CMD_ARG (disable , NULL , NULL , cmd_disable , 1 , 0 ),
2552
2559
SHELL_CMD_ARG (release , NULL , NULL , cmd_release , 1 , 0 ),
2553
- SHELL_CMD_ARG (select_unicast , NULL , "<stream>" ,
2554
- cmd_select_unicast , 2 , 0 ),
2560
+ SHELL_CMD_ARG (select_unicast , NULL , "<stream>" , cmd_select_unicast , 2 , 0 ),
2555
2561
#endif /* CONFIG_BT_BAP_UNICAST */
2556
2562
SHELL_CMD_ARG (preset , NULL , "<sink, source, broadcast> [preset]" , cmd_preset , 2 , 1 ),
2563
+ #if defined(CONFIG_BT_AUDIO_TX )
2557
2564
SHELL_CMD_ARG (send , NULL , "Send to Audio Stream [data]" , cmd_send , 1 , 1 ),
2558
2565
#if defined(CONFIG_LIBLC3 )
2559
2566
SHELL_CMD_ARG (start_sine , NULL , "Start sending a LC3 encoded sine wave" , cmd_start_sine , 1 ,
2560
2567
0 ),
2561
2568
SHELL_CMD_ARG (stop_sine , NULL , "Stop sending a LC3 encoded sine wave" , cmd_stop_sine , 1 , 0 ),
2562
2569
#endif /* CONFIG_LIBLC3 */
2570
+ #endif /* CONFIG_BT_AUDIO_TX */
2563
2571
SHELL_COND_CMD_ARG (CONFIG_BT_PACS , set_location , NULL ,
2564
2572
"<direction: sink, source> <location bitmask>" , cmd_set_loc , 3 , 0 ),
2565
2573
SHELL_COND_CMD_ARG (CONFIG_BT_PACS , set_context , NULL ,
0 commit comments