@@ -45,10 +45,8 @@ static uint8_t oob_legacy_tk[16] = { 0 };
45
45
46
46
static bool filter_list_in_use ;
47
47
48
- #if !defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY )
49
48
static struct bt_le_oob oob_sc_local = { 0 };
50
49
static struct bt_le_oob oob_sc_remote = { 0 };
51
- #endif /* !defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) */
52
50
53
51
/* connection parameters for rejection test */
54
52
#define REJECT_INTERVAL_MIN 0x0C80
@@ -266,10 +264,10 @@ static uint8_t supported_commands(const void *cmd, uint16_t cmd_len,
266
264
267
265
/* octet 3 */
268
266
tester_set_bit (rp -> data , BTP_GAP_OOB_LEGACY_SET_DATA );
269
- # if !defined (CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY )
270
- tester_set_bit (rp -> data , BTP_GAP_OOB_SC_GET_LOCAL_DATA );
271
- tester_set_bit (rp -> data , BTP_GAP_OOB_SC_SET_REMOTE_DATA );
272
- #endif /* !defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) */
267
+ if (! IS_ENABLED (CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY )) {
268
+ tester_set_bit (rp -> data , BTP_GAP_OOB_SC_GET_LOCAL_DATA );
269
+ tester_set_bit (rp -> data , BTP_GAP_OOB_SC_SET_REMOTE_DATA );
270
+ }
273
271
tester_set_bit (rp -> data , BTP_GAP_SET_MITM );
274
272
tester_set_bit (rp -> data , BTP_GAP_SET_FILTER_LIST );
275
273
#if defined(CONFIG_BT_EXT_ADV )
@@ -308,9 +306,9 @@ static uint8_t controller_info(const void *cmd, uint16_t cmd_len,
308
306
/*
309
307
* Re-use the oob data read here in get_oob_sc_local_data()
310
308
*/
311
- # if !defined (CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY )
312
- oob_sc_local = oob_local ;
313
- #endif /* !defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) */
309
+ if (! IS_ENABLED (CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY )) {
310
+ oob_sc_local = oob_local ;
311
+ }
314
312
315
313
/*
316
314
* If privacy is used, the device uses random type address, otherwise
@@ -339,9 +337,11 @@ static uint8_t controller_info(const void *cmd, uint16_t cmd_len,
339
337
return BTP_STATUS_SUCCESS ;
340
338
}
341
339
342
- #if !defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY )
343
340
static const char * oob_config_str (int oob_config )
344
341
{
342
+ if (!IS_ENABLED (CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY )) {
343
+ return "no" ;
344
+ }
345
345
switch (oob_config ) {
346
346
case BT_CONN_OOB_LOCAL_ONLY :
347
347
return "Local" ;
@@ -354,7 +354,6 @@ static const char *oob_config_str(int oob_config)
354
354
return "no" ;
355
355
}
356
356
}
357
- #endif /* !defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) */
358
357
359
358
static void oob_data_request (struct bt_conn * conn ,
360
359
struct bt_conn_oob_info * oob_info )
@@ -371,9 +370,12 @@ static void oob_data_request(struct bt_conn *conn,
371
370
bt_addr_le_to_str (info .le .dst , addr , sizeof (addr ));
372
371
373
372
switch (oob_info -> type ) {
374
- #if !defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY )
375
373
case BT_CONN_OOB_LE_SC :
376
374
{
375
+ if (!IS_ENABLED (CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY )) {
376
+ LOG_ERR ("OOB LE SC not supported" );
377
+ break ;
378
+ }
377
379
LOG_DBG ("Set %s OOB SC data for %s, " ,
378
380
oob_config_str (oob_info -> lesc .oob_config ),
379
381
addr );
@@ -411,7 +413,6 @@ static void oob_data_request(struct bt_conn *conn,
411
413
412
414
break ;
413
415
}
414
- #endif /* !defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) */
415
416
416
417
#if !defined(CONFIG_BT_SMP_SC_PAIR_ONLY )
417
418
case BT_CONN_OOB_LE_LEGACY :
@@ -430,7 +431,7 @@ static void oob_data_request(struct bt_conn *conn,
430
431
}
431
432
}
432
433
433
- #if !defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY )
434
+ # if !defined (CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY )
434
435
static uint8_t get_oob_sc_local_data (const void * cmd , uint16_t cmd_len ,
435
436
void * rsp , uint16_t * rsp_len )
436
437
{
0 commit comments