Cypress PSoC 6 Bluetooth Low Energy Middleware Library 3.60
Link Layer Privacy API

General Description

The API are used for enable user to use Link Layer Privacy feature of BLE Stack.

Functions

void Cy_BLE_EnablePrivacyFeature (void)
 This function enables Link Layer (LL) Privacy feature in the BLE Stack. More...
 
cy_en_ble_api_result_t Cy_BLE_AddDeviceToResolvingList (cy_stc_ble_resolving_device_info_t *param)
 This function is used to add a device to the Resolving List in the controller for resolving Resolvable Private Address (RPA). More...
 
cy_en_ble_api_result_t Cy_BLE_GetPeerResolvableAddress (cy_stc_ble_peer_id_addr_t *param)
 This function is used to get the current peer Resolvable Private Address being used for the given peer Public address or Static Random address. More...
 
cy_en_ble_api_result_t Cy_BLE_GetLocalResolvableAddress (cy_stc_ble_peer_id_addr_t *param)
 This function is used to get the current local Resolvable Private Address being used for the given peer public address or the static random address. More...
 
cy_en_ble_api_result_t Cy_BLE_RemoveDeviceFromResolvingList (cy_stc_ble_peer_id_addr_t *param)
 This function is used to remove one device from the Resolving List used to resolve Resolvable Private Addresses in the BLE Stack. More...
 
cy_en_ble_api_result_t Cy_BLE_SetResolvablePvtAddressTimeOut (uint16_t param)
 This function is used to set the length of time the controller uses a Resolvable Private Address before a new resolvable private address is generated and starts being used. More...
 
cy_en_ble_api_result_t Cy_BLE_SetAddressResolutionEnable (uint8_t param)
 This function is used to enable resolution of Resolvable Private Addresses in the BLE Stack. More...
 
cy_en_ble_api_result_t Cy_BLE_GetResolvingList (cy_stc_ble_resolving_list_retention_t const **param)
 This function is used to get Resolving List. More...
 
cy_en_ble_api_result_t Cy_BLE_SetPrivacyMode (cy_stc_ble_privacy_mode_info_t *privacyModeInfo)
 This function is used to allow the application to specify the Privacy mode to be used for a given entry on the Resolving List. More...
 

Function Documentation

◆ Cy_BLE_EnablePrivacyFeature()

void Cy_BLE_EnablePrivacyFeature ( void  )

This function enables Link Layer (LL) Privacy feature in the BLE Stack.

LL privacy feature is disabled and memory space for the feature is not used by default. This function is called by the BLE Component during BLE initialization if the CY_BLE_CONFIG_ENABLE_LL_PRIVACY macro is set by the user.

Returns
None.

◆ Cy_BLE_AddDeviceToResolvingList()

cy_en_ble_api_result_t Cy_BLE_AddDeviceToResolvingList ( cy_stc_ble_resolving_device_info_t param)

This function is used to add a device to the Resolving List in the controller for resolving Resolvable Private Address (RPA).

This function can be used to update local and/or peer IRKs for an existing Resolving List entry by passing the same peer address type and peer address in the argument.

Status of the operation is informed through the status parameter returned along with the 'CY_BLE_EVT_ADD_DEVICE_TO_RPA_LIST_COMPLETE' event. If the status is success (0x00u), the 'CY_BLE_EVT_PENDING_FLASH_WRITE' event is generated by the BLE Stack. This indicates that BLE Stack internal data structures are modified and require backup.

Parameters
paramparameter is of type 'cy_stc_ble_resolving_device_info_t'
Returns
cy_en_ble_api_result_t : Return value indicates whether the function succeeded or failed. Following are the possible error codes.
Error codes Description
CY_BLE_SUCCESS On successful operation.
CY_BLE_ERROR_INVALID_PARAMETER On specifying NULL for input parameter.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED Memory allocation failed.
CY_BLE_ERROR_INSUFFICIENT_RESOURCES BLE Stack resources are unavailable.

◆ Cy_BLE_GetPeerResolvableAddress()

cy_en_ble_api_result_t Cy_BLE_GetPeerResolvableAddress ( cy_stc_ble_peer_id_addr_t param)

This function is used to get the current peer Resolvable Private Address being used for the given peer Public address or Static Random address.

The peer's resolvable address being used may change after the command is called.

This is a non-blocking function. Peer resolvable address is informed through 'CY_BLE_EVT_GET_PEER_RPA_COMPLETE' event.

Parameters
paramBuffer that contains the information of peer identity address and address type
Returns
cy_en_ble_api_result_t : Return value indicates whether the function succeeded or failed. Following are the possible error codes.
Errors codes Description
CY_BLE_SUCCESS On successful operation.
CY_BLE_ERROR_INVALID_PARAMETER Input parameter is NULL.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED If Memory allocation failed.
CY_BLE_ERROR_INSUFFICIENT_RESOURCES If BLE Stack resources are unavailable.

◆ Cy_BLE_GetLocalResolvableAddress()

cy_en_ble_api_result_t Cy_BLE_GetLocalResolvableAddress ( cy_stc_ble_peer_id_addr_t param)

This function is used to get the current local Resolvable Private Address being used for the given peer public address or the static random address.

The local resolvable address being used may change after the command is called.

This is a non-blocking function. Local resolvable address is informed through 'CY_BLE_EVT_GET_LOCAL_RPA_COMPLETE' event.

Parameters
paramBuffer that contains the information of peer identity address and address type.
Returns
cy_en_ble_api_result_t : Return value indicates whether the function succeeded or failed. Following are the possible error codes.
Errors codes Description
CY_BLE_SUCCESS On successful operation.
CY_BLE_ERROR_INVALID_PARAMETER Input parameter is NULL.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED If Memory allocation failed.
CY_BLE_ERROR_INSUFFICIENT_RESOURCES If BLE Stack resources are unavailable.

◆ Cy_BLE_RemoveDeviceFromResolvingList()

cy_en_ble_api_result_t Cy_BLE_RemoveDeviceFromResolvingList ( cy_stc_ble_peer_id_addr_t param)

This function is used to remove one device from the Resolving List used to resolve Resolvable Private Addresses in the BLE Stack.

Passing all zeroes as address parameter clears the Resolving List.

Status of operation is informed through the status parameter returned along with the 'CY_BLE_EVT_REMOVE_DEVICE_FROM_RPA_LIST_COMPLETE' event. If the status is success (0x00u), the 'CY_BLE_EVT_PENDING_FLASH_WRITE' event is generated by the BLE Stack. This indicates that BLE Stack internal data structures are modified and require backup.

Parameters
paramBuffer that contains the information of peer ID address and address type. If all bytes of peer ID address as well as address type are zero, this function will clear the entire Resolving List.
Returns
cy_en_ble_api_result_t : Return value indicates whether the function succeeded or failed. Following are the possible error codes.
Error codes Description
CY_BLE_SUCCESS On successful operation.
CY_BLE_ERROR_INVALID_PARAMETER On specifying NULL for input parameter.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED Memory allocation failed.
CY_BLE_ERROR_INSUFFICIENT_RESOURCES BLE Stack resources are unavailable.

◆ Cy_BLE_SetResolvablePvtAddressTimeOut()

cy_en_ble_api_result_t Cy_BLE_SetResolvablePvtAddressTimeOut ( uint16_t  param)

This function is used to set the length of time the controller uses a Resolvable Private Address before a new resolvable private address is generated and starts being used.

This timeout applies to all addresses generated by the BLE Stack.

This is a non-blocking function. Request complete is informed through 'CY_BLE_EVT_SET_RPA_TO_COMPLETE' event.

Parameters
paramRPA_Timeout measured in seconds. Range for N: 0x0001 - 0xA1B8 (1 sec - approximately 11.5 hours) Default: N= 0x0384 (900 secs or 15 minutes)
Returns
cy_en_ble_api_result_t : Return value indicates whether the function succeeded or failed. Following are the possible error codes.
Errors codes Description
CY_BLE_SUCCESS On successful operation.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED If Memory allocation failed.
CY_BLE_ERROR_INSUFFICIENT_RESOURCES If BLE Stack resources are unavailable.

◆ Cy_BLE_SetAddressResolutionEnable()

cy_en_ble_api_result_t Cy_BLE_SetAddressResolutionEnable ( uint8_t  param)

This function is used to enable resolution of Resolvable Private Addresses in the BLE Stack.

This causes the BLE Stack to use the Resolving List whenever the Controller receives a local or peer Resolvable Private Address.

This is a non-blocking function. Request complete is informed through 'CY_BLE_EVT_SET_RPA_ENABLE_COMPLETE' event.

Parameters
param0x00 - Address Resolution in Controller is disabled (default)
0x01 - Address Resolution in Controller is enabled
0x02 - 0xFF Reserved for Future Use
Returns
cy_en_ble_api_result_t : Return value indicates whether the function succeeded or failed. Following are the possible error codes.
Errors codes Description
CY_BLE_SUCCESS On successful operation.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED If Memory allocation failed.
CY_BLE_ERROR_INSUFFICIENT_RESOURCES If BLE Stack resources are unavailable.

◆ Cy_BLE_GetResolvingList()

cy_en_ble_api_result_t Cy_BLE_GetResolvingList ( cy_stc_ble_resolving_list_retention_t const **  param)

This function is used to get Resolving List.

This function is a blocking call. Hence no event will be generated.

Parameters
paramPointer to store the base address of Resolving List.
Returns
cy_en_ble_api_result_t : Return value indicates whether the function succeeded or failed. Following are the possible error codes.
Error codes Description
CY_BLE_SUCCESS On successful operation.
CY_BLE_ERROR_INVALID_PARAMETER On specifying NULL for input parameter.
CY_BLE_ERROR_INVALID_OPERATION If Privacy feature is not enabled.

Note : The Resolving List memory is maintained by the BLE stack. The application should not modify the contents using the pointer provided by the BLE Stack.

◆ Cy_BLE_SetPrivacyMode()

cy_en_ble_api_result_t Cy_BLE_SetPrivacyMode ( cy_stc_ble_privacy_mode_info_t privacyModeInfo)

This function is used to allow the application to specify the Privacy mode to be used for a given entry on the Resolving List.

The effect of this setting is specified in Bluetooth 5.0 Core Specification [Vol 6] Part B, Section 4.7.

When an entry on the Resolving List is removed, the mode associated with that entry is also removed.

This is a non-blocking function. Successful operation will be informed through the 'CY_BLE_EVT_SET_PRIVACY_MODE_COMPLETE' event.

Parameters
privacyModeInfoBuffer that contains the information of peer address, peer address type, and Privacy mode.
Returns
cy_en_ble_api_result_t : Return value indicates whether the function succeeded or failed. Following are the possible error codes.
Error codes Description
CY_BLE_SUCCESS On successful operation.
CY_BLE_ERROR_INVALID_PARAMETER On specifying NULL for input parameter.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED Memory allocation failed.
CY_BLE_ERROR_INSUFFICIENT_RESOURCES BLE Stack resources are unavailable.