Cypress PSoC 6 Bluetooth Low Energy Middleware Library 3.60

General Description

The API are used for enable user to use Whitelist feature of BLE Stack.

Functions

cy_en_ble_api_result_t Cy_BLE_AddDeviceToWhiteList (cy_stc_ble_bd_addr_t *param)
 This function adds the device to the White List. More...
 
cy_en_ble_api_result_t Cy_BLE_RemoveDeviceFromWhiteList (cy_stc_ble_bd_addr_t *param)
 This function removes the specified device from the White List. More...
 
cy_en_ble_api_result_t Cy_BLE_GetWhiteList (cy_stc_ble_white_list_retention_t const **param)
 This function is used to get the White List. More...
 

Function Documentation

◆ Cy_BLE_AddDeviceToWhiteList()

cy_en_ble_api_result_t Cy_BLE_AddDeviceToWhiteList ( cy_stc_ble_bd_addr_t param)

This function adds the device to the White List.

The maximum number of devices that can be added to the White List is configurable using the CY_BLE_CONFIG_MAX_WHITE_LIST_SIZE macro. Refer to Bluetooth 5.0 core specification, Volume 3, Part C, section 9.3.5 for more details on White List.

Status of the operation is informed through the status parameter returned along with the 'CY_BLE_EVT_ADD_DEVICE_TO_WHITE_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
paramPeer device address of type cy_stc_ble_bd_addr_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 'param' or bdAddr 'type' has an invalid value.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED Memory allocation failed.
CY_BLE_ERROR_INSUFFICIENT_RESOURCES BLE Stack resources are unavailable.

◆ Cy_BLE_RemoveDeviceFromWhiteList()

cy_en_ble_api_result_t Cy_BLE_RemoveDeviceFromWhiteList ( cy_stc_ble_bd_addr_t param)

This function removes the specified device from the White List.

Completion of operation is informed through the status parameter which is returned along with the 'CY_BLE_EVT_REMOVE_DEVICE_FROM_WHITE_LIST_COMPLETE' event. Completion operation triggers the 'CY_BLE_EVT_PENDING_FLASH_WRITE' event.

Parameters
paramPointer to peer device address, of type cy_stc_ble_bd_addr_t. If the device address is set to 0, then all devices shall be removed from the trusted White List.
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 On specifying NULL as input parameter.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED If Memory allocation failed.
CY_BLE_ERROR_INSUFFICIENT_RESOURCES If BLE Stack resources are unavailable.

◆ Cy_BLE_GetWhiteList()

cy_en_ble_api_result_t Cy_BLE_GetWhiteList ( cy_stc_ble_white_list_retention_t const **  param)

This function is used to get the White List.

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

Parameters
paramPointer pointing to the base address of the White List..
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 On specifying NULL as input parameter.

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