mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-19 08:20:00 +00:00
apps/bttester: fix check for address type in advertising_start()
Encapsulated cases in correct configuration check (BTTESTER_PRIVACY_MODE). Used simple bit comparison, as glue module was dropped.
This commit is contained in:
committed by
Szymon Janc
parent
3c4bc60cae
commit
338cb747f0
+12
-12
@@ -488,19 +488,19 @@ start_advertising(const void *cmd, uint16_t cmd_len,
|
||||
switch (addr_type) {
|
||||
case 0x00:
|
||||
break;
|
||||
#if defined(CONFIG_BT_PRIVACY)
|
||||
#if MYNEWT_VAL(BTTESTER_PRIVACY_MODE)
|
||||
case 0x01:
|
||||
/* RPA usage is is controlled via privacy settings */
|
||||
if (!atomic_test_bit(¤t_settings, BTP_GAP_SETTINGS_PRIVACY)) {
|
||||
return BTP_STATUS_FAILED;
|
||||
}
|
||||
break;
|
||||
case 0x02:
|
||||
/* NRPA is used only for non-connectable advertising */
|
||||
if (atomic_test_bit(¤t_settings, BTP_GAP_SETTINGS_CONNECTABLE)) {
|
||||
return BTP_STATUS_FAILED;
|
||||
}
|
||||
break;
|
||||
/* RPA usage is is controlled via privacy settings */
|
||||
if (!(current_settings & BIT(BTP_GAP_SETTINGS_PRIVACY))) {
|
||||
return BTP_STATUS_FAILED;
|
||||
}
|
||||
break;
|
||||
case 0x02:
|
||||
/* NRPA is used only for non-connectable advertising */
|
||||
if (!(current_settings & BIT(BTP_GAP_SETTINGS_CONNECTABLE))) {
|
||||
return BTP_STATUS_FAILED;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return BTP_STATUS_FAILED;
|
||||
|
||||
Reference in New Issue
Block a user