You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by na...@apache.org on 2019/06/05 11:01:45 UTC
[mynewt-nimble] branch master updated: apps/bttester: Add option to
use NRPA
This is an automated email from the ASF dual-hosted git repository.
naraj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new 7e49794 apps/bttester: Add option to use NRPA
7e49794 is described below
commit 7e497944bd6d64ef5885669ee63833be9dffd42c
Author: MichaĆ Narajowski <mi...@codecoup.pl>
AuthorDate: Tue Jun 4 13:09:14 2019 +0200
apps/bttester: Add option to use NRPA
This is needed to pass TP/BROB/BCST/BV-04-C.
---
apps/bttester/src/gap.c | 8 ++++++--
apps/bttester/syscfg.yml | 6 +++++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/apps/bttester/src/gap.c b/apps/bttester/src/gap.c
index d738224..2365804 100644
--- a/apps/bttester/src/gap.c
+++ b/apps/bttester/src/gap.c
@@ -155,13 +155,17 @@ static void controller_info(u8_t *data, u16_t len)
memset(&rp, 0, sizeof(rp));
- rc = ble_hs_id_gen_rnd(0, &addr);
+ rc = ble_hs_id_gen_rnd(MYNEWT_VAL(BTTESTER_USE_NRPA), &addr);
assert(rc == 0);
rc = ble_hs_id_set_rnd(addr.val);
assert(rc == 0);
if (MYNEWT_VAL(BTTESTER_PRIVACY_MODE)) {
- own_addr_type = BLE_OWN_ADDR_RPA_RANDOM_DEFAULT;
+ if (MYNEWT_VAL(BTTESTER_USE_NRPA)) {
+ own_addr_type = BLE_OWN_ADDR_RANDOM;
+ } else {
+ own_addr_type = BLE_OWN_ADDR_RPA_RANDOM_DEFAULT;
+ }
atomic_set_bit(¤t_settings, GAP_SETTINGS_PRIVACY);
supported_settings |= BIT(GAP_SETTINGS_PRIVACY);
memcpy(rp.address, addr.val, sizeof(rp.address));
diff --git a/apps/bttester/syscfg.yml b/apps/bttester/syscfg.yml
index 6f33825..92c8671 100644
--- a/apps/bttester/syscfg.yml
+++ b/apps/bttester/syscfg.yml
@@ -40,7 +40,11 @@ syscfg.defs:
value: 512
BTTESTER_PRIVACY_MODE:
- description: Use Resolvable Private Address
+ description: Enable privacy mode (RPA or NRPA)
+ value: 0
+
+ BTTESTER_USE_NRPA:
+ description: Use Non Resolvable Private Address
value: 0
BTTESTER_LTD_ADV_TIMEOUT: