Skip to content

Commit

Permalink
apps/bttester: fix check for address type in advertising_start()
Browse files Browse the repository at this point in the history
Encapsulated cases in correct configuration check
(BTTESTER_PRIVACY_MODE). Used simple bit comparison, as glue module was
dropped.
  • Loading branch information
KKopyscinski authored and sjanc committed Aug 2, 2023
1 parent 3c4bc60 commit 338cb74
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions apps/bttester/src/btp_gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(&current_settings, BTP_GAP_SETTINGS_PRIVACY)) {
return BTP_STATUS_FAILED;
}
break;
case 0x02:
/* NRPA is used only for non-connectable advertising */
if (atomic_test_bit(&current_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;
Expand Down

0 comments on commit 338cb74

Please sign in to comment.