@@ -264,9 +264,9 @@ static uint8_t supported_commands(const void *cmd, uint16_t cmd_len,
264
264
}
265
265
tester_set_bit (rp -> data , BTP_GAP_SET_MITM );
266
266
tester_set_bit (rp -> data , BTP_GAP_SET_FILTER_LIST );
267
- # if defined( CONFIG_BT_EXT_ADV )
268
- tester_set_bit (rp -> data , BTP_GAP_SET_EXTENDED_ADVERTISING );
269
- #endif
267
+ if ( IS_ENABLED ( CONFIG_BT_EXT_ADV )) {
268
+ tester_set_bit (rp -> data , BTP_GAP_SET_EXTENDED_ADVERTISING );
269
+ }
270
270
271
271
* rsp_len = sizeof (* rp ) + 4 ;
272
272
@@ -425,7 +425,7 @@ static void oob_data_request(struct bt_conn *conn,
425
425
}
426
426
}
427
427
428
- # if !defined (CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY )
428
+ #if !defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY )
429
429
static uint8_t get_oob_sc_local_data (const void * cmd , uint16_t cmd_len ,
430
430
void * rsp , uint16_t * rsp_len )
431
431
{
@@ -516,16 +516,22 @@ static struct bt_data ad[10] = {
516
516
};
517
517
static struct bt_data sd [10 ];
518
518
519
- #if defined(CONFIG_BT_EXT_ADV )
520
519
static struct bt_le_ext_adv * ext_adv ;
521
520
522
521
struct bt_le_ext_adv * tester_gap_ext_adv_get (void )
523
522
{
523
+ if (!IS_ENABLED (CONFIG_BT_EXT_ADV )) {
524
+ return NULL ;
525
+ }
524
526
return ext_adv ;
525
527
}
526
528
527
529
int tester_gap_start_ext_adv (void )
528
530
{
531
+ if (!IS_ENABLED (CONFIG_BT_EXT_ADV )) {
532
+ return - ENOTSUP ;
533
+ }
534
+
529
535
int err ;
530
536
531
537
err = bt_le_ext_adv_start (ext_adv , BT_LE_EXT_ADV_START_DEFAULT );
@@ -542,6 +548,10 @@ int tester_gap_start_ext_adv(void)
542
548
543
549
int tester_gap_stop_ext_adv (void )
544
550
{
551
+ if (!IS_ENABLED (CONFIG_BT_EXT_ADV )) {
552
+ return - ENOTSUP ;
553
+ }
554
+
545
555
int err ;
546
556
547
557
err = bt_le_ext_adv_stop (ext_adv );
@@ -555,7 +565,6 @@ int tester_gap_stop_ext_adv(void)
555
565
556
566
return 0 ;
557
567
}
558
- #endif /* defined(CONFIG_BT_EXT_ADV) */
559
568
560
569
static uint8_t set_discoverable (const void * cmd , uint16_t cmd_len ,
561
570
void * rsp , uint16_t * rsp_len )
@@ -744,12 +753,9 @@ static uint8_t start_advertising(const void *cmd, uint16_t cmd_len,
744
753
return BTP_STATUS_FAILED ;
745
754
}
746
755
747
- # if defined( CONFIG_BT_EXT_ADV )
748
- if ( atomic_test_bit (& current_settings , BTP_GAP_SETTINGS_EXTENDED_ADVERTISING )) {
756
+ if ( IS_ENABLED ( CONFIG_BT_EXT_ADV ) &&
757
+ atomic_test_bit (& current_settings , BTP_GAP_SETTINGS_EXTENDED_ADVERTISING )) {
749
758
err = bt_le_ext_adv_start (ext_adv , BT_LE_EXT_ADV_START_DEFAULT );
750
- #else
751
- if (0 ) {
752
- #endif
753
759
} else {
754
760
err = bt_le_adv_start (& param , ad , adv_len , sd_len ? sd : NULL , sd_len );
755
761
}
@@ -1370,27 +1376,27 @@ static uint8_t set_filter_list(const void *cmd, uint16_t cmd_len,
1370
1376
return BTP_STATUS_SUCCESS ;
1371
1377
}
1372
1378
1373
- static uint8_t set_extended_advertising (const void * cmd , uint16_t cmd_len ,
1374
- void * rsp , uint16_t * rsp_len )
1379
+ #if defined(CONFIG_BT_EXT_ADV )
1380
+ static uint8_t set_extended_advertising (const void * cmd , uint16_t cmd_len , void * rsp ,
1381
+ uint16_t * rsp_len )
1375
1382
{
1376
1383
const struct btp_gap_set_extended_advertising_cmd * cp = cmd ;
1377
1384
struct btp_gap_set_extended_advertising_rp * rp = rsp ;
1378
1385
1379
1386
LOG_DBG ("ext adv settings: %u" , cp -> settings );
1380
1387
1381
1388
if (cp -> settings != 0 ) {
1382
- atomic_set_bit (& current_settings ,
1383
- BTP_GAP_SETTINGS_EXTENDED_ADVERTISING );
1389
+ atomic_set_bit (& current_settings , BTP_GAP_SETTINGS_EXTENDED_ADVERTISING );
1384
1390
} else {
1385
- atomic_clear_bit (& current_settings ,
1386
- BTP_GAP_SETTINGS_EXTENDED_ADVERTISING );
1391
+ atomic_clear_bit (& current_settings , BTP_GAP_SETTINGS_EXTENDED_ADVERTISING );
1387
1392
}
1388
1393
1389
1394
rp -> current_settings = sys_cpu_to_le32 (current_settings );
1390
1395
1391
1396
* rsp_len = sizeof (* rp );
1392
1397
return BTP_STATUS_SUCCESS ;
1393
1398
}
1399
+ #endif /* defined(CONFIG_BT_EXT_ADV) */
1394
1400
1395
1401
#if defined(CONFIG_BT_PER_ADV )
1396
1402
static struct bt_data padv [10 ];
0 commit comments