NimBLE: Add Host based privacy (RPA) feature support (v4.0)
- This feature removes dependency on controller to use privacy (RPA)
This commit is contained in:
parent
6ee1947822
commit
5f7436006f
5 changed files with 19 additions and 3 deletions
|
@ -464,6 +464,7 @@ if(CONFIG_BT_ENABLED)
|
||||||
"host/nimble/nimble/nimble/host/src/ble_hs_adv.c"
|
"host/nimble/nimble/nimble/host/src/ble_hs_adv.c"
|
||||||
"host/nimble/nimble/nimble/host/src/ble_hs_hci.c"
|
"host/nimble/nimble/nimble/host/src/ble_hs_hci.c"
|
||||||
"host/nimble/nimble/nimble/host/src/ble_hs_hci_util.c"
|
"host/nimble/nimble/nimble/host/src/ble_hs_hci_util.c"
|
||||||
|
"host/nimble/nimble/nimble/host/src/ble_hs_resolv.c"
|
||||||
"host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c"
|
"host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c"
|
||||||
"host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c"
|
"host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c"
|
||||||
"host/nimble/nimble/nimble/host/store/config/src/ble_store_nvs.c"
|
"host/nimble/nimble/nimble/host/store/config/src/ble_store_nvs.c"
|
||||||
|
|
|
@ -257,6 +257,15 @@ config BT_NIMBLE_HS_FLOW_CTRL_TX_ON_DISCONNECT
|
||||||
Enable this option to send number-of-completed-packets event to
|
Enable this option to send number-of-completed-packets event to
|
||||||
controller after disconnection
|
controller after disconnection
|
||||||
|
|
||||||
|
config BT_NIMBLE_RPA_TIMEOUT
|
||||||
|
int "RPA timeout in seconds"
|
||||||
|
range 1 41400
|
||||||
|
depends on BT_NIMBLE_ENABLED
|
||||||
|
default 900
|
||||||
|
help
|
||||||
|
Time interval between RPA address change. This is applicable in case of
|
||||||
|
Host based RPA
|
||||||
|
|
||||||
menuconfig BT_NIMBLE_MESH
|
menuconfig BT_NIMBLE_MESH
|
||||||
bool "Enable BLE mesh functionality"
|
bool "Enable BLE mesh functionality"
|
||||||
select BT_NIMBLE_SM_SC
|
select BT_NIMBLE_SM_SC
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit d4ba1367c8cb093c414154f5ce9d8a3af1c0a1b1
|
Subproject commit 0eb95974b6f58db017bb63330aa9654330c1301d
|
|
@ -535,8 +535,12 @@
|
||||||
#define MYNEWT_VAL_BLE_MONITOR_UART_DEV ("uart0")
|
#define MYNEWT_VAL_BLE_MONITOR_UART_DEV ("uart0")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef MYNEWT_VAL_BLE_HOST_BASED_PRIVACY
|
||||||
|
#define MYNEWT_VAL_BLE_HOST_BASED_PRIVACY (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef MYNEWT_VAL_BLE_RPA_TIMEOUT
|
#ifndef MYNEWT_VAL_BLE_RPA_TIMEOUT
|
||||||
#define MYNEWT_VAL_BLE_RPA_TIMEOUT (300)
|
#define MYNEWT_VAL_BLE_RPA_TIMEOUT (CONFIG_BT_NIMBLE_RPA_TIMEOUT)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MYNEWT_VAL_BLE_SM_BONDING
|
#ifndef MYNEWT_VAL_BLE_SM_BONDING
|
||||||
|
|
|
@ -10,9 +10,11 @@ This example aims at understanding GATT database configuration, advertisement an
|
||||||
|
|
||||||
It also demonstrates security features of NimBLE stack. SMP parameters like I/O capabilities of device, Bonding flag, MITM protection flag and Secure Connection only mode etc., can be configured through menuconfig options.
|
It also demonstrates security features of NimBLE stack. SMP parameters like I/O capabilities of device, Bonding flag, MITM protection flag and Secure Connection only mode etc., can be configured through menuconfig options.
|
||||||
|
|
||||||
|
For RPA feature (currently Host based privacy feature is supported), use API `ble_hs_pvcy_rpa_config` to enable/disable host based privacy, `own_addr_type` needs to be set to `BLE_ADDR_RANDOM` to use this feature. Please include `ble_hs_pvcy.h` while using this API. As `ble_hs_pvcy_rpa_config` configures host privacy and sets address in controller, it is necessary to call this API after host-controller are synced (e.g. in `bleprph_on_sync` callback).
|
||||||
|
|
||||||
To test this demo, any BLE scanner app can be used.
|
To test this demo, any BLE scanner app can be used.
|
||||||
|
|
||||||
A Python based utility `bleprph_test.py` is also provided (which will run as a BLE GATT Client) and can be used to test this example.
|
A Python based utility `bleprph_test.py` is also provided (which will run as a BLE GATT Client) and can be used to test this example.
|
||||||
|
|
||||||
Note :
|
Note :
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue