Skip to content

Commit 7dd5987

Browse files
nimble/ll: Add option to initialize random device address by default
This adds an option to initialize random device address by default using an address retrieved from an address provider.
1 parent 7408f88 commit 7dd5987

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

nimble/controller/src/ble_ll_addr.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,12 @@ ble_ll_addr_init(void)
4848
ble_ll_addr_provide_public(g_dev_addr);
4949
#endif
5050

51+
#if MYNEWT_VAL(BLE_LL_ADDR_INIT_RANDOM)
52+
/* Set random address from provider API, if available */
53+
#if MYNEWT_API_ble_addr_provider_random
54+
ble_ll_addr_provide_static(g_random_addr);
55+
#endif
56+
#endif
57+
5158
return 0;
5259
}

nimble/controller/syscfg.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,12 @@ syscfg.defs:
395395
not intended for production builds.
396396
value: 0x000000000000
397397

398+
BLE_LL_ADDR_INIT_RANDOM:
399+
description: >
400+
Initializes default random address with a static random address
401+
retrieved from an address provider, if available.
402+
value: 1
403+
398404
BLE_LL_DTM:
399405
description: >
400406
Enables HCI Test commands needed for Bluetooth SIG certification

0 commit comments

Comments
 (0)