![]() |
Bluetooth LE Profile API document
Bluetooth LE Profile API document Rev.1.00 [May 22, 2020]
|
The privacy feature allows local device to change the address in order not to be identified from other devices.
The privacy feature uses one of the following addresses.
R_BLE GAP API supports the both addresses.
This section describes the privacy feature.
The following steps are necessary to use RPA in Controller.
Step 1 : Generation and registration of local IRK
Generate 16 bytes random number as an IRK and register it and local device's identity address to host stack by R_BLE_GAP_SetLocIdInfo().
The IRK is to be distributed to a remote device in pairing.
Step 2 : Enable RPA function
Enable RPA function in Controller by R_BLE_GAP_EnableRpa().
The completion of enabling RPA functionality is notified by BLE_GAP_EVENT_RPA_EN_COMP event.
Step 3 : Register local IRK in Resolving List
The IRK of local device is registered in Resolving List to generate a RPA by R_BLE_GAP_ConfRslvList().
An address and a IRK of any remote device is also registered at the time.
The completion of the registration is notified by BLE_GAP_EVENT_RSLV_LIST_CONF_COMP event.
Step 4 : Configuration of RPA timeout
Controller changes RPA every 900s by default.
The update time may be changed by R_BLE_GAP_SetRpaTo(). The completion of the configuration is notified by BLE_GAP_EVENT_SET_RPA_TO_COMP event.
Step 5 : Configuration of Privacy Mode
Privacy Mode has two types; Network Privacy Mode and Device Privacy Mode.
In Network Privacy Mode, both local device and remote device use RPA.
In Device Privacy Mode, only local device uses RPA.
By default, Controller is set to Network Privacy Mode.
The Privacy Mode may be changed by R_BLE_GAP_SetPrivMode().
The completion of the configuration is notified by BLE_GAP_EVENT_PRIV_MODE_SET_COMP event.
Step 6 : Start privacy with RPA
When RPA is specified as local device's address type in starting advertising(by R_BLE_GAP_SetAdvParam()) or scanning(by R_BLE_GAP_StartScan()) or creating a link(by R_BLE_GAP_CreateConn() ), the packet that includes RPA is sent.
If you use R_BLE_GAP_SetAdvParam(), set the address type for using RPA to o_addr_type field and set the peer address type and the peer address that has been registered in Resolving List to the p_addr_type field and the p_addr field respectively.
The RPA of local device may be acquired by R_BLE_GAP_ReadRpa().
The completion of the retrieval is notified by BLE_GAP_EVENT_RD_RPA_COMP event.
The following steps are necessary to resolve the RPA of a remote device.
Step 1 : Enable RPA function
Enable RPA function in Controller by R_BLE_GAP_EnableRpa(). The completion of the configuration is notified by BLE_GAP_EVENT_RPA_EN_COMP event.
Step 2 : Register the IRK and the identity address of the remote device in Resolving List
The IRK and the identity address of the remote device are registered in Resolving List by R_BLE_GAP_ConfRslvList() to resolve the RPA of the remote device .
The completion of the registration is notified by BLE_GAP_EVENT_RSLV_LIST_CONF_COMP event.
Step 3 : Configuration of Privacy Mode
The Privacy Mode may be changed by R_BLE_GAP_SetPrivMode(). The completion of the configuration is notified by BLE_GAP_EVENT_PRIV_MODE_SET_COMP event.
Step 4 : Resolution of the RPA of the remote device
After step 1 - 3, Controller can resolve the RPA of the remote device used in advertising packet, scan request packet, connection request packet and notify the application layer the identity address of the remote device.
The procedure to use Non-RPA has different from between advertising and scanning, creating a link.
When Non-RPA is used in advertising, the advertising set needs to be set Non-RPA.
When the o_addr field in the advertising parameters is set to a Non-RPA as Figure 2.1 and the address type is set to random address, the advertising set is set to the Non-RPA.
After the advertising set was set to the Non-RPA, when advertising has started by R_BLE_GAP_StartAdv(), advertising PDUs with Non-RPA are sent.
When Non-RPA is used in scanning and creating a link, Controller needs to be set Non-RPA by R_BLE_GAP_SetRandAddr().
The completion of the configuration is notified by BLE_GAP_EVENT_RAND_ADDR_SET_COMP event.
After Controller has been set to a Non-RPA, when scanning(R_BLE_GAP_StartScan()) or creating a link(R_BLE_GAP_CreateConn()) starts with Non-RPA, Scan Request packets or Connection Request packets that include Non-RPA are sent.
Note: If Non-RPA is used, the application layer needs to update Non-RPA every rpa timeout.