@@ -147,8 +147,7 @@ static int unicast_client_ep_set_metadata(struct bt_bap_ep *ep, void *data, uint
147
147
static int unicast_client_ep_set_codec_cfg (struct bt_bap_ep * ep , uint8_t id , uint16_t cid ,
148
148
uint16_t vid , void * data , uint8_t len ,
149
149
struct bt_audio_codec_cfg * codec_cfg );
150
- static int unicast_client_ep_start (struct bt_bap_ep * ep ,
151
- struct net_buf_simple * buf );
150
+ static int unicast_client_ep_start (struct bt_bap_ep * ep , struct net_buf_simple * buf );
152
151
153
152
static int unicast_client_ase_discover (struct bt_conn * conn , uint16_t start_handle );
154
153
@@ -160,8 +159,7 @@ static void unicast_client_ep_set_status(struct bt_bap_ep *ep, struct net_buf_si
160
159
static int unicast_client_send_start (struct bt_bap_ep * ep )
161
160
{
162
161
if (ep -> receiver_ready != true || ep -> dir != BT_AUDIO_DIR_SOURCE ) {
163
- LOG_DBG ("Invalid ep %p %u %s" ,
164
- ep , ep -> receiver_ready , bt_audio_dir_str (ep -> dir ));
162
+ LOG_DBG ("Invalid ep %p %u %s" , ep , ep -> receiver_ready , bt_audio_dir_str (ep -> dir ));
165
163
166
164
return - EINVAL ;
167
165
}
@@ -181,8 +179,7 @@ static int unicast_client_send_start(struct bt_bap_ep *ep)
181
179
182
180
err = unicast_client_ep_start (ep , buf );
183
181
if (err != 0 ) {
184
- LOG_DBG ("unicast_client_ep_start failed: %d" ,
185
- err );
182
+ LOG_DBG ("unicast_client_ep_start failed: %d" , err );
186
183
187
184
return err ;
188
185
}
@@ -199,8 +196,7 @@ static int unicast_client_send_start(struct bt_bap_ep *ep)
199
196
200
197
static void unicast_client_ep_idle_state (struct bt_bap_ep * ep );
201
198
202
- static struct bt_bap_stream * audio_stream_by_ep_id (const struct bt_conn * conn ,
203
- uint8_t id )
199
+ static struct bt_bap_stream * audio_stream_by_ep_id (const struct bt_conn * conn , uint8_t id )
204
200
{
205
201
#if CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT > 0 || CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT > 0
206
202
const uint8_t conn_index = bt_conn_index (conn );
@@ -343,8 +339,8 @@ static void unicast_client_ep_iso_connected(struct bt_bap_ep *ep)
343
339
return ;
344
340
}
345
341
346
- LOG_DBG ("stream %p ep %p dir %s receiver_ready %u" ,
347
- stream , ep , bt_audio_dir_str ( ep -> dir ), ep -> receiver_ready );
342
+ LOG_DBG ("stream %p ep %p dir %s receiver_ready %u" , stream , ep , bt_audio_dir_str ( ep -> dir ),
343
+ ep -> receiver_ready );
348
344
349
345
#if defined(CONFIG_BT_BAP_DEBUG_STREAM_SEQ_NUM )
350
346
/* reset sequence number */
@@ -1561,10 +1557,10 @@ static uint8_t unicast_client_cp_notify(struct bt_conn *conn,
1561
1557
ase_rsp = net_buf_simple_pull_mem (& buf , sizeof (* ase_rsp ));
1562
1558
1563
1559
LOG_DBG ("op %s (0x%02x) id 0x%02x code %s (0x%02x) "
1564
- "reason %s (0x%02x)" , bt_ascs_op_str ( rsp -> op ), rsp -> op ,
1565
- ase_rsp -> id , bt_ascs_rsp_str ( ase_rsp -> code ) ,
1566
- ase_rsp -> code , bt_ascs_reason_str ( ase_rsp -> reason ) ,
1567
- ase_rsp -> reason );
1560
+ "reason %s (0x%02x)" ,
1561
+ bt_ascs_op_str ( rsp -> op ), rsp -> op , ase_rsp -> id ,
1562
+ bt_ascs_rsp_str ( ase_rsp -> code ), ase_rsp -> code ,
1563
+ bt_ascs_reason_str ( ase_rsp -> reason ), ase_rsp -> reason );
1568
1564
1569
1565
stream = audio_stream_by_ep_id (conn , ase_rsp -> id );
1570
1566
if (stream == NULL ) {
@@ -1983,7 +1979,6 @@ int bt_bap_unicast_client_ep_qos(struct bt_bap_ep *ep, struct net_buf_simple *bu
1983
1979
1984
1980
req = net_buf_simple_add (buf , sizeof (* req ));
1985
1981
req -> ase = ep -> status .id ;
1986
- /* TODO: don't hardcode CIG and CIS, they should come from ISO */
1987
1982
req -> cig = conn_iso -> info .unicast .cig_id ;
1988
1983
req -> cis = conn_iso -> info .unicast .cis_id ;
1989
1984
sys_put_le24 (qos -> interval , req -> interval );
@@ -2278,7 +2273,7 @@ static void unicast_client_ep_reset(struct bt_conn *conn, uint8_t reason)
2278
2273
}
2279
2274
2280
2275
static void bt_bap_qos_cfg_to_cig_param (struct bt_iso_cig_param * cig_param ,
2281
- const struct bt_bap_unicast_group * group )
2276
+ const struct bt_bap_unicast_group * group )
2282
2277
{
2283
2278
cig_param -> framing = group -> cig_param .framing ;
2284
2279
cig_param -> c_to_p_interval = group -> cig_param .c_to_p_interval ;
@@ -2380,8 +2375,7 @@ static int bt_audio_cig_reconfigure(struct bt_bap_unicast_group *group)
2380
2375
return 0 ;
2381
2376
}
2382
2377
2383
- static void audio_stream_qos_cleanup (const struct bt_conn * conn ,
2384
- struct bt_bap_unicast_group * group )
2378
+ static void audio_stream_qos_cleanup (const struct bt_conn * conn , struct bt_bap_unicast_group * group )
2385
2379
{
2386
2380
struct bt_bap_stream * stream ;
2387
2381
@@ -2500,8 +2494,7 @@ static void unicast_client_qos_cfg_to_iso_qos(struct bt_bap_iso *iso,
2500
2494
}
2501
2495
2502
2496
static void unicast_group_set_iso_stream_param (struct bt_bap_unicast_group * group ,
2503
- struct bt_bap_iso * iso ,
2504
- struct bt_bap_qos_cfg * qos ,
2497
+ struct bt_bap_iso * iso , struct bt_bap_qos_cfg * qos ,
2505
2498
enum bt_audio_dir dir )
2506
2499
{
2507
2500
/* Store the stream Codec QoS in the bap_iso */
@@ -2673,14 +2666,12 @@ static void unicast_group_free(struct bt_bap_unicast_group *group)
2673
2666
2674
2667
static int stream_param_check (const struct bt_bap_unicast_group_stream_param * param )
2675
2668
{
2676
- CHECKIF (param -> stream == NULL )
2677
- {
2669
+ CHECKIF (param -> stream == NULL ) {
2678
2670
LOG_DBG ("param->stream is NULL" );
2679
2671
return - EINVAL ;
2680
2672
}
2681
2673
2682
- CHECKIF (param -> qos == NULL )
2683
- {
2674
+ CHECKIF (param -> qos == NULL ) {
2684
2675
LOG_DBG ("param->qos is NULL" );
2685
2676
return - EINVAL ;
2686
2677
}
@@ -2690,8 +2681,7 @@ static int stream_param_check(const struct bt_bap_unicast_group_stream_param *pa
2690
2681
return - EALREADY ;
2691
2682
}
2692
2683
2693
- CHECKIF (bt_audio_verify_qos (param -> qos ) != BT_BAP_ASCS_REASON_NONE )
2694
- {
2684
+ CHECKIF (bt_audio_verify_qos (param -> qos ) != BT_BAP_ASCS_REASON_NONE ) {
2695
2685
LOG_DBG ("Invalid QoS" );
2696
2686
return - EINVAL ;
2697
2687
}
@@ -2703,8 +2693,7 @@ static int stream_pair_param_check(const struct bt_bap_unicast_group_stream_pair
2703
2693
{
2704
2694
int err ;
2705
2695
2706
- CHECKIF (param -> rx_param == NULL && param -> tx_param == NULL )
2707
- {
2696
+ CHECKIF (param -> rx_param == NULL && param -> tx_param == NULL ) {
2708
2697
LOG_DBG ("Invalid stream parameters" );
2709
2698
return - EINVAL ;
2710
2699
}
@@ -2875,13 +2864,12 @@ static bool valid_unicast_group_param(struct bt_bap_unicast_group *unicast_group
2875
2864
}
2876
2865
2877
2866
int bt_bap_unicast_group_create (struct bt_bap_unicast_group_param * param ,
2878
- struct bt_bap_unicast_group * * out_unicast_group )
2867
+ struct bt_bap_unicast_group * * out_unicast_group )
2879
2868
{
2880
2869
struct bt_bap_unicast_group * unicast_group ;
2881
2870
int err ;
2882
2871
2883
- CHECKIF (out_unicast_group == NULL )
2884
- {
2872
+ CHECKIF (out_unicast_group == NULL ) {
2885
2873
LOG_DBG ("out_unicast_group is NULL" );
2886
2874
return - EINVAL ;
2887
2875
}
@@ -3030,17 +3018,16 @@ int bt_bap_unicast_group_reconfig(struct bt_bap_unicast_group *unicast_group,
3030
3018
}
3031
3019
3032
3020
int bt_bap_unicast_group_add_streams (struct bt_bap_unicast_group * unicast_group ,
3033
- struct bt_bap_unicast_group_stream_pair_param params [],
3034
- size_t num_param )
3021
+ struct bt_bap_unicast_group_stream_pair_param params [],
3022
+ size_t num_param )
3035
3023
{
3036
3024
struct bt_bap_stream * tmp_stream ;
3037
3025
size_t total_stream_cnt ;
3038
3026
struct bt_iso_cig * cig ;
3039
3027
size_t num_added ;
3040
3028
int err ;
3041
3029
3042
- CHECKIF (unicast_group == NULL )
3043
- {
3030
+ CHECKIF (unicast_group == NULL ) {
3044
3031
LOG_DBG ("unicast_group is NULL" );
3045
3032
return - EINVAL ;
3046
3033
}
@@ -3050,14 +3037,12 @@ int bt_bap_unicast_group_add_streams(struct bt_bap_unicast_group *unicast_group,
3050
3037
return - EINVAL ;
3051
3038
}
3052
3039
3053
- CHECKIF (params == NULL )
3054
- {
3040
+ CHECKIF (params == NULL ) {
3055
3041
LOG_DBG ("params is NULL" );
3056
3042
return - EINVAL ;
3057
3043
}
3058
3044
3059
- CHECKIF (num_param == 0 )
3060
- {
3045
+ CHECKIF (num_param == 0 ) {
3061
3046
LOG_DBG ("num_param is 0" );
3062
3047
return - EINVAL ;
3063
3048
}
@@ -3126,8 +3111,7 @@ int bt_bap_unicast_group_delete(struct bt_bap_unicast_group *unicast_group)
3126
3111
{
3127
3112
struct bt_bap_stream * stream ;
3128
3113
3129
- CHECKIF (unicast_group == NULL )
3130
- {
3114
+ CHECKIF (unicast_group == NULL ) {
3131
3115
LOG_DBG ("unicast_group is NULL" );
3132
3116
return - EINVAL ;
3133
3117
}
@@ -3776,8 +3760,7 @@ static bool any_ases_found(const struct unicast_client *client)
3776
3760
return true;
3777
3761
}
3778
3762
3779
- static uint8_t unicast_client_ase_discover_cb (struct bt_conn * conn ,
3780
- const struct bt_gatt_attr * attr ,
3763
+ static uint8_t unicast_client_ase_discover_cb (struct bt_conn * conn , const struct bt_gatt_attr * attr ,
3781
3764
struct bt_gatt_discover_params * discover )
3782
3765
{
3783
3766
struct unicast_client * client ;
@@ -4357,38 +4340,36 @@ static uint8_t unicast_client_read_func(struct bt_conn *conn, uint8_t err,
4357
4340
LOG_DBG ("pac #%u/%u" , i + 1 , rsp -> num_pac );
4358
4341
4359
4342
if (buf -> len < sizeof (* pac_codec )) {
4360
- LOG_ERR ("Malformed PAC: remaining len %u expected %zu" ,
4361
- buf -> len , sizeof (* pac_codec ));
4343
+ LOG_ERR ("Malformed PAC: remaining len %u expected %zu" , buf -> len ,
4344
+ sizeof (* pac_codec ));
4362
4345
break ;
4363
4346
}
4364
4347
4365
4348
pac_codec = net_buf_simple_pull_mem (buf , sizeof (* pac_codec ));
4366
4349
4367
4350
if (buf -> len < sizeof (* cc )) {
4368
- LOG_ERR ("Malformed PAC: remaining len %u expected %zu" ,
4369
- buf -> len , sizeof (* cc ));
4351
+ LOG_ERR ("Malformed PAC: remaining len %u expected %zu" , buf -> len ,
4352
+ sizeof (* cc ));
4370
4353
break ;
4371
4354
}
4372
4355
4373
4356
cc = net_buf_simple_pull_mem (buf , sizeof (* cc ));
4374
4357
if (buf -> len < cc -> len ) {
4375
- LOG_ERR ("Malformed PAC: remaining len %u expected %zu" ,
4376
- buf -> len , cc -> len );
4358
+ LOG_ERR ("Malformed PAC: remaining len %u expected %zu" , buf -> len , cc -> len );
4377
4359
break ;
4378
4360
}
4379
4361
4380
4362
cc_ltv = net_buf_simple_pull_mem (buf , cc -> len );
4381
4363
4382
4364
if (buf -> len < sizeof (* meta )) {
4383
- LOG_ERR ("Malformed PAC: remaining len %u expected %zu" ,
4384
- buf -> len , sizeof (* meta ));
4365
+ LOG_ERR ("Malformed PAC: remaining len %u expected %zu" , buf -> len ,
4366
+ sizeof (* meta ));
4385
4367
break ;
4386
4368
}
4387
4369
4388
4370
meta = net_buf_simple_pull_mem (buf , sizeof (* meta ));
4389
4371
if (buf -> len < meta -> len ) {
4390
- LOG_ERR ("Malformed PAC: remaining len %u expected %u" ,
4391
- buf -> len , meta -> len );
4372
+ LOG_ERR ("Malformed PAC: remaining len %u expected %u" , buf -> len , meta -> len );
4392
4373
break ;
4393
4374
}
4394
4375
@@ -4429,8 +4410,7 @@ static uint8_t unicast_client_read_func(struct bt_conn *conn, uint8_t err,
4429
4410
return BT_GATT_ITER_STOP ;
4430
4411
}
4431
4412
4432
- static uint8_t unicast_client_pac_discover_cb (struct bt_conn * conn ,
4433
- const struct bt_gatt_attr * attr ,
4413
+ static uint8_t unicast_client_pac_discover_cb (struct bt_conn * conn , const struct bt_gatt_attr * attr ,
4434
4414
struct bt_gatt_discover_params * discover )
4435
4415
{
4436
4416
struct unicast_client * client = & uni_cli_insts [bt_conn_index (conn )];
0 commit comments