Common

group group_ble_common_api_definitions

Contains the common definitions and data structures used in the BLE.

Typedefs

typedef void (*cy_ble_app_ev_cb_t)(cy_en_ble_event_t event, void *evParam)

Event callback function prototype to receive events from BLE Stack.

typedef uint16_t (*cy_ble_hci_rx_cb_t)(uint8_t type, uint8_t *packet, uint8_t length)

callback function prototype to receive DTM packet from Controller

Enums

enum cy_en_ble_interrupt_callback_feature_t

cy_en_ble_interrupt_callback_feature_t: Interrupt callback feature.

Values:

enumerator CY_BLE_INTR_CALLBACK_NONE

Interrupt callback feature is disabled.

enumerator CY_BLE_INTR_CALLBACK_BLESS_STACK_ISR

Executed on every trigger of BLESS interrupt.

enumerator CY_BLE_INTR_CALLBACK_BLESS_INTR_STAT_DSM_EXITED

Executed when the BLESS exits BLESS deep sleep mode and enters BLESS active mode.

BLESS deep sleep exit can be triggered automatically by link layer hardware or by different BLE_PDL data transfer APIs that need BLESS to be active.

enumerator CY_BLE_INTR_CALLBACK_BLELL_CONN_EXT_INTR_EARLY

Executed when the BLESS connection engine in slave mode detects a BLE packet that matches its access address.

enumerator CY_BLE_INTR_CALLBACK_BLELL_CONN_INTR_CE_RX

Executed when the BLESS connection engine receives a non-empty packet from the peer device.

enumerator CY_BLE_INTR_CALLBACK_BLELL_CONN_INTR_CE_TX_ACK

Executed when the BLESS connection engine receives an ACK packet from the peer device for the previously transmitted packet.

enumerator CY_BLE_INTR_CALLBACK_BLELL_CONN_INTR_CLOSE_CE

Executed when the BLESS connection engine closes the connection event.

This interrupt will be executed on every connection interval for a connection, irrespective of data tx/rx state.

enumerator CY_BLE_INTR_CALLBACK_BLESS_INTR_STAT_DSM_ENTERED

Executed when the BLESS enters deep sleep mode.

User call to Cy_SysPm_DeepSleep API will trigger BLESS deep sleep entry sequence.

enumerator CY_BLE_INTR_CALLBACK_BLELL_SCAN_INTR_ADV_RX

Executed when the BLESS scan engine receives an advertisement packet from the peer device.

enumerator CY_BLE_INTR_CALLBACK_BLELL_SCAN_INTR_SCAN_RSP_RX

Executed when the BLESS scan engine receives a scan response packet from the peer device in response to a scan request from the scanner.

enumerator CY_BLE_INTR_CALLBACK_BLELL_ADV_INTR_CONN_REQ_RX

Executed when the BLESS advertisement engine receives a connection request from the peer central device.

enum cy_en_ble_api_result_t

cy_en_ble_api_result_t: Common error codes received as API result.

Values:

enumerator CY_BLE_SUCCESS

No Error occurred.

enumerator CY_BLE_INFO_FLASH_WRITE_IN_PROGRESS

Flash operation in progress.

enumerator CY_BLE_ERROR_INVALID_PARAMETER

At least one of the input parameters is invalid.

enumerator CY_BLE_ERROR_INVALID_OPERATION

Operation is not permitted.

enumerator CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED

An internal error occurred in the BLE Stack.

enumerator CY_BLE_ERROR_INSUFFICIENT_RESOURCES

Insufficient resources to perform requested operation.

enumerator CY_BLE_ERROR_OOB_NOT_AVAILABLE

OOB data not available.

enumerator CY_BLE_ERROR_NO_CONNECTION

Connection is required to perform requested operation.

Connection not present

enumerator CY_BLE_ERROR_NO_DEVICE_ENTITY

No device entity to perform requested operation.

enumerator CY_BLE_ERROR_DEVICE_ALREADY_EXISTS

Device cannot be added to the White List as it has already been added.

enumerator CY_BLE_ERROR_REPEATED_ATTEMPTS

Attempted repeat operation is not allowed.

enumerator CY_BLE_ERROR_GAP_ROLE

GAP role is incorrect.

enumerator CY_BLE_ERROR_SEC_FAILED

Security operation failed.

enumerator CY_BLE_ERROR_L2CAP_PSM_WRONG_ENCODING

L2CAP PSM encoding is incorrect.

enumerator CY_BLE_ERROR_L2CAP_PSM_ALREADY_REGISTERED

L2CAP PSM has already been registered.

enumerator CY_BLE_ERROR_L2CAP_PSM_NOT_REGISTERED

L2CAP PSM has not been registered.

enumerator CY_BLE_ERROR_L2CAP_CONNECTION_ENTITY_NOT_FOUND

L2CAP connection entity not found.

enumerator CY_BLE_ERROR_L2CAP_PSM_NOT_IN_RANGE

Specified PSM is out of range.

enumerator CY_BLE_ERROR_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE

Unsupported feature or parameter value.

enumerator CY_BLE_ERROR_FLASH_WRITE_NOT_PERMITED

Write to Flash is not permitted.

enumerator CY_BLE_ERROR_FLASH_WRITE

Error in Flash write.

enumerator CY_BLE_ERROR_MIC_AUTH_FAILED

MIC Authentication failure.

enumerator CY_BLE_ERROR_HARDWARE_FAILURE

Hardware Failure.

Possible reason - BLE ECO failed to start due to one of the below:

  • LFCLK (WCO, PILO, ILO) not present

  • Radio bus failure

enumerator CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE

GATT DB error codes.

Invalid attribute handle

enumerator CY_BLE_ERROR_NTF_DISABLED

Characteristic notifications disabled.

enumerator CY_BLE_ERROR_IND_DISABLED

Characteristic indications disabled.

enumerator CY_BLE_ERROR_CONTROLLER_BUSY

Controller Busy.

enumerator CY_BLE_ERROR_INVALID_STATE

The state is not valid for current operation.

enumerator CY_BLE_ERROR_MAX

All other errors not covered in the above list map to this error code.

enum cy_en_ble_bless_pwr_lvl_t

cy_en_ble_bless_pwr_lvl_t: BLESS Power enum reflecting power level values supported by BLESS radio.

Values:

enumerator CY_BLE_LL_PWR_LVL_NEG_20_DBM

ABS PWR = -20 dBm.

enumerator CY_BLE_LL_PWR_LVL_NEG_16_DBM

ABS PWR = -16 dBm.

enumerator CY_BLE_LL_PWR_LVL_NEG_12_DBM

ABS PWR = -12 dBm.

enumerator CY_BLE_LL_PWR_LVL_NEG_6_DBM

ABS PWR = -6 dBm.

enumerator CY_BLE_LL_PWR_LVL_0_DBM

ABS PWR = 0 dBm.

enumerator CY_BLE_LL_PWR_LVL_MAX

ABS PWR = +4 dBm as per silicon.

enum cy_en_ble_bless_phy_ch_grp_id_t

cy_en_ble_bless_phy_ch_grp_id_t: BLE channel group ID.

Values:

enumerator CY_BLE_LL_ADV_CH_TYPE

Advertisement channel type.

enumerator CY_BLE_LL_CONN_CH_TYPE

Connection channel type.

enumerator CY_BLE_LL_MAX_CH_TYPE

Maximum value of the cy_en_ble_bless_phy_ch_grp_id_t type.

enum cy_en_ble_bless_wco_sca_cfg_t

cy_en_ble_bless_wco_sca_cfg_t: BLE WCO sleep clock accuracy configuration.

Values:

enumerator CY_BLE_LL_SCA_251_TO_500_PPM

BLE WCO sleep clock accuracy 251 to 500 ppm.

enumerator CY_BLE_LL_SCA_151_TO_250_PPM

BLE WCO sleep clock accuracy 151 to 250 ppm.

enumerator CY_BLE_LL_SCA_101_TO_150_PPM

BLE WCO sleep clock accuracy 101 to 150 ppm.

enumerator CY_BLE_LL_SCA_076_TO_100_PPM

BLE WCO sleep clock accuracy 76 to 100 ppm.

enumerator CY_BLE_LL_SCA_051_TO_075_PPM

BLE WCO sleep clock accuracy 51 to 75 ppm.

enumerator CY_BLE_LL_SCA_031_TO_050_PPM

BLE WCO sleep clock accuracy 31 to 50 ppm.

enumerator CY_BLE_LL_SCA_021_TO_030_PPM

BLE WCO sleep clock accuracy 21 to 30 ppm.

enumerator CY_BLE_LL_SCA_000_TO_020_PPM

BLE WCO sleep clock accuracy 0 to 20 ppm.

enumerator CY_BLE_LL_SCA_IN_PPM_INVALID

BLE WCO invalid sleep clock accuracy.

enum cy_en_ble_bless_eco_clk_div_t

cy_en_ble_bless_eco_clk_div_t: BLE ECO clock divider.

Values:

enumerator CY_BLE_LL_ECO_CLK_DIV_1

Link Layer clock divider = 1.

enumerator CY_BLE_LL_ECO_CLK_DIV_2

Link Layer clock divider = 2.

enumerator CY_BLE_LL_ECO_CLK_DIV_4

Link Layer clock divider = 4.

enumerator CY_BLE_LL_ECO_CLK_DIV_8

Link Layer clock divider = 8.

enumerator CY_BLE_LL_ECO_CLK_DIV_INVALID

Invalid Link Layer clock divider.

enum cy_en_ble_bless_state_t

cy_en_ble_bless_state_t: BLESS Power enum reflecting power states supported by BLESS radio.

Values:

enumerator CY_BLE_BLESS_STATE_ACTIVE
enumerator CY_BLE_BLESS_STATE_EVENT_CLOSE
enumerator CY_BLE_BLESS_STATE_ECO_ON
enumerator CY_BLE_BLESS_STATE_ECO_STABLE
enumerator CY_BLE_BLESS_STATE_DEEPSLEEP
enumerator CY_BLE_BLESS_STATE_STOPPED
enumerator CY_BLE_BLESS_STATE_INVALID
enum cy_en_ble_controller_sleep_mode_t

cy_en_ble_controller_sleep_mode_t: Sleep mode which controller core is trying to enter.

Values:

enumerator CY_BLE_CONTROLLER_SLEEP_MODE_SLEEP
enumerator CY_BLE_CONTROLLER_SLEEP_MODE_DEEPSLEEP
enum cy_en_ble_to_reason_code_t

cy_en_ble_to_reason_code_t: Timeout reason due to BLE Stack started timers or application stated timers.

It is the application’s responsibility to disconnect or keep the connection, depending on the type of timeout; for example, for a GATT procedure timeout: the application may choose to disconnect.

Values:

enumerator CY_BLE_GAP_ADV_TO

Advertisement time set by application has expired.

enumerator CY_BLE_GAP_SCAN_TO

Scan time set by application has expired.

enumerator CY_BLE_GATT_RSP_TO

GATT procedure timeout.

enumerator CY_BLE_GENERIC_APP_TO

Application procedure timeout.

enum cy_en_ble_protocol_req_t

cy_en_ble_protocol_req_t: BLE Stack memory request type.

Values:

enumerator CY_BLE_PREPARED_WRITE_REQUEST

Memory requested for prepare write request.

enumerator CY_BLE_INVALID_REQUEST

Invalid request.

enum cy_en_ble_phy_mask_t

cy_en_ble_phy_mask_t: PHY used for the connection.

Values:

enumerator CY_BLE_PHY_MASK_LE_1M

The transmitter PHY for the connection is LE 1M.

enumerator CY_BLE_PHY_MASK_LE_2M

The transmitter PHY for the connection is LE 2M.

enumerator CY_BLE_PHY_MASK_LE_CODED

The transmitter PHY for the connection is LE Coded.

enum cy_en_ble_phy_no_pref_mask_t

cy_en_ble_phy_no_pref_mask_t: PHY preference masks used for Cy_BLE_SetPhy() function.

Values:

enumerator CY_BLE_PHY_NO_PREF_MASK_NONE

All PHY settings are preferred by the HOST.

enumerator CY_BLE_PHY_NO_PREF_MASK_TX

Host has no preference for TX PHY.

enumerator CY_BLE_PHY_NO_PREF_MASK_RX

Host has no preference for RX PHY.

enumerator CY_BLE_PHY_NO_PREF_MASK_BOTH_TX_RX

Host has no preference for both TX & RX PHY.

enum cy_en_ble_privacy_mode_t

cy_en_ble_privacy_mode_t: Privacy modes used for Cy_BLE_SetPrivacyMode() function.

Values:

enumerator CY_BLE_PRIVACY_MODE_NETWORK
enumerator CY_BLE_PRIVACY_MODE_DEVICE
struct cy_stc_ble_stack_lib_version_t
#include <cy_ble_stack.h>

This structure is used to hold version information of the BLE Stack Library.

Public Members

uint8_t majorVersion

The major version of the library.

uint8_t minorVersion

The minor version of the library.

uint8_t patch

The patch number of the library.

uint16_t buildNumber

The build number of the library.

struct cy_stc_ble_bd_addr_t
#include <cy_ble_stack.h>

Bluetooth Device Address type.

Public Members

uint8_t bdAddr[CY_BLE_BD_ADDR_SIZE]

Bluetooth device address.

uint8_t type

public = 0, Random = 1

struct cy_stc_ble_dle_config_param_t
#include <cy_ble_stack.h>

Configuration structure for Tx and Rx ACL Data Buffers required by the BLE Stack.

All the configurations specified are valid per connection and all the supported LL connections will have same capability.

Public Members

uint16_t dleMaxTxCapability

Tx buffer size configuration for the BLE Stack per the LL Connection.

uint16_t dleMaxRxCapability

Rx buffer size configuration for the BLE Stack per the LL Connection.

uint8_t dleNumTxBuffer

Total number of Tx buffer configuration per LL Connection for the BLE Stack.

uint8_t dleNumRxBuffer

Total number of Rx buffer configuration per LL Connection for BLE Stack.

struct cy_stc_ble_l2cap_config_param_t
#include <cy_ble_stack.h>

Configuration structure for the L2CAP buffer for data transmission.

Public Members

uint8_t l2capBufferPerConn

This specifies L2CAP stack queue depth per connection for data tx.

The application must provide heap memory based on the following calculation: l2capBufferPerConn * maxBleConnections * CY_BLE_L2CAP_QUEUE_ELEMENT_SIZE

struct cy_stc_ble_privacy_1_2_config_param_t
#include <cy_ble_stack.h>

Configuration structure for LL Privacy feature.

Public Members

uint8_t resolvingListSize

Maximum number of possible entries in Resolving List.

struct cy_stc_ble_bonded_device_list_config_param_t
#include <cy_ble_stack.h>

Configuration parameter for Bonded Devices List.

Public Members

uint8_t bondListSize

Maximum number of possible entries in Bonded Devices List.

struct cy_stc_ble_white_list_config_param_t
#include <cy_ble_stack.h>

Configuration parameter for the White List.

Public Members

uint8_t whiteListSize

Maximum number of possible entries in the White List.

struct cy_stc_ble_mxd_pa_cal_param_t
#include <cy_ble_stack.h>

Configuration parameter for Radio PA calibration.

Public Members

uint16_t lobuffTable[CY_BLE_MXD_PA_NUM_LOBUFF_VALS]

LOBUFF value Table

Parameter

Table Index

LOBUFF_5dBm

0

LOBUFF_4dBm

1

LOBUFF_0dBm

2

LOBUFF_n6dBm

3

---------------

-----------

Note: Non-zero entries to the below table will over-ride the Cypress recommended radio PA settings.

uint16_t targetTable[CY_BLE_MXD_PA_NUM_TARGET_VALS]

Target Value Table

Parameter

Table Index

TARGET_5dBm

0

TARGET_4dBm

1

TARGET_0dBm

2

TARGET_n6dBm

3

TARGET_n12dBm

4

TARGET_n16dBm

5

TARGET_n20dBm

6

---------------

-----------

Note: Non-zero entries to the below table will over-ride the Cypress recommended radio PA settings.

uint8_t lobuffLimit

Limit beyond which gain begins to rail.

Note: Non-zero entries to the below element will over-ride the Cypress recommended radio PA settings.

uint16_t calValLimit

Calibration Ceiling.

Note: Non-zero entries to the below element will over-ride the Cypress recommended radio PA settings.

uint16_t ldoVoltageTable[CY_BLE_MXD_PA_NUM_LDO_SETTINGS]

Parameter

Table Index

ACT LDO 0dBm

0

ACT LDO 4dBm

1

PA LDO 0dBm

2

PA LDO 4dBm

3

--------------

-----------

Note: Non-zero entries to the below table will over-ride the Cypress recommended radio PA settings.

struct cy_stc_ble_stack_config_param_t
#include <cy_ble_stack.h>

Configuration structure for enabling selective features and passing associated parameters.

Public Members

cy_stc_ble_dle_config_param_t dleConfig

Configuration parameter for DLE feature.

cy_stc_ble_l2cap_config_param_t l2capConfig

Configuration parameter for L2CAP buffer.

cy_stc_ble_privacy_1_2_config_param_t privacyConfig

Configuration parameter for privacy 1.2 feature.

cy_stc_ble_bonded_device_list_config_param_t bondListConfig

Configuration parameter for Bonded Devices List.

cy_stc_ble_white_list_config_param_t whiteListConfig

Configuration parameter for White List.

cy_stc_ble_mxd_pa_cal_param_t paCalConfig

Configuration parameter for Radio PA calibration.

uint16_t featureMask

The feature set mask used to control usage of specified feature in the BLE stack.

If a feature is not selected, then associated parameter pointer can be NULL. Feature Mask Values : B0 : DLE_FEATURE_MASK B1 : PRIVACY_1_2_FEATURE_MASK B2 : SECURE_CONN_FEATURE_MASK B3 : PHY_UPDATE_FEATURE_MASK B4 : PERSISTENT_STORE_BONDLIST B5 : PERSISTENT_STORE_RESOLVING_LIST B6 : PERSISTENT_STORE_WHITELIST B7 : PERSISTENT_RADIO_CALIBRATION_MASK

uint16_t featureHeapReq

Out parameter for returning memory requirement for selected features.

uint8_t maxBleConnections

Configuration parameter for Maximum number of BLE Connection Max possible value is 4 and Min configuration value is 1.

struct cy_stc_ble_stk_app_data_buff_t
#include <cy_ble_stack.h>

Set of buffers to be allocated by BLE Stack for BLE Stack operation.

Public Members

uint16_t bufferSize

Size of the buffer chunk.

uint16_t bufferUnits

Number of the buffers units of ‘bufferSize’.

struct cy_stc_ble_conn_estb_param_t
#include <cy_ble_stack.h>

Structure for passing the connection established parameters.

Public Members

uint8_t bdHandle

bd handle of the device

uint32_t accessAddr

Link layer access address.

struct cy_stc_ble_stack_mgr_mem_cfg_param_t
#include <cy_ble_stack.h>

BLE Stack Manager configuration structure for allocating memory pools for host and controller operation.

Public Members

uint8_t *memoryHeapPtr

Memory Heap pointer.

cy_stc_ble_stk_app_data_buff_t *dataBuff

Set of buffers needed for BLE Stack operation.

uint16_t totalHeapSz

Memory heap pointer size.

uint8_t totalDataBufferPools

Total data buffer pools.

const uint8_t *bleStackFlashPointer

Pointer to an array of bytes to be allocated by the BLE Component for the storing the persistent data into the Flash.

Pointer provided is should be aligned to the Flash boundary.

uint32_t bleStackFlashSize

Size of the total Flash memory pointed by bleStackFlashPointer.

struct cy_stc_ble_stack_init_info_t
#include <cy_ble_stack.h>

BLE Stack init parameter.

Public Members

cy_ble_app_ev_cb_t CyBleAppCbFunc

Application Callback Function Configuration.

cy_stc_ble_stack_mgr_mem_cfg_param_t memParam

BLE Stack Manager Memory Configuration.

cy_stc_ble_stack_config_param_t stackConfig

BLE Stack configuration parameter.

struct cy_stc_ble_aes_cmac_generate_param_t
#include <cy_ble_stack.h>

Structure containing the parameters required for AES CMAC Generation.

Public Members

uint8_t *buffer

pointer to message for which AES CMAC must be calculated, LSB should be first

uint16_t size

size of the message buffer

uint8_t *key

AES CMAC 128-bit Key, LSB should be first.

uint8_t *mac

output-parameter, Buffer to hold generated MAC of 16 bytes.

Output is LSB first

struct cy_stc_ble_bless_clk_cfg_params_t
#include <cy_ble_stack.h>

BLE clock configuration parameters.

Public Members

cy_en_ble_bless_wco_sca_cfg_t bleLlSca

Sleep Clock accuracy in PPM, 32Khz Cycles.

cy_en_ble_bless_eco_clk_div_t bleLlClockDiv

Link Layer clock divider.

struct cy_stc_ble_hci_tx_packet_info_t
#include <cy_ble_stack.h>

Standard HCI command/data packet.

Public Members

uint8_t *data

Buffer to hold the HCI packet HCI Command Packet guide:

0 4 8 12 16 20 24 28 32 Octet 0 Octet 1 Octet 2 Octet 3 +——–+——–+——–+——–+ | Opcode | Parameter | | ———————| Total |Parameter 0| | OCF | OGF | Length | | +——–+——–+——–+——–+ |Parameter 1| | Parameter … | +——–+——–+——–+——–+ | | | * | | * | | * | | | +——–+——–+——–+——–+ | Param N-1 | Parameter N | +——–+——–+——–+——–+

HCI Event Packet guide:

0 4 8 12 16 20 24 28 32 Octet 0 Octet 1 Octet 2 Octet 3 +——–+——–+——–+——–+ |Event Code | Parameter | | | | | Total |Parameter 0|Parameter 1| | | Length | | | +——–+——–+——–+——–+ |Parameter 1| Parameter … | +——–+——–+——–+——–+ | | | * | | * | | * | | | +——–+——–+——–+——–+ | Param N-1 | Parameter N | +——–+——–+——–+——–+

HCI ACL Packet Guide:

0 4 8 +——————–+——–+———-+ | HCI HEADER | L2CAP HEADER | | |(only in Start of packet)| |——————–|———————-| |PDU Octet 1 |2 |3 |4 |5 |6 | ***** | |——————–+———————-| | * | | * | | * | |——————–+———————-| | ****|N-2 |N-1 |PDU Octet N (upto 247)| +——————–+———————-+

The ACL Packet HCI Header contains the following information: +___________________________________________________+ |Conn Handle (12 bits)|Pkt Boundary (2 bits)| |———————-|———————-+ |HCI_LLID(2 bits)— |Length(16 bits) | +———————-|———————-+

Note:

  1. Packet Boundary data indicates the following: +———-+—————+—————+ | | Application to | Controller to | | | Controller | Application | +———-|—————|—————| | 0x0u | Start of PDU | RESERVED | | 0x1u | Continuation PDU | RESERVED | | 0x2u | RESERVED | Start of PDU | | 0x3u | RESERVED | Continuation PDU | +———-+—————+—————+

  2. HCI_LLID data indicates the following: +———-+—————| | 0x0u | Start of PDU | | 0x1u | Continuation PDU | | 0x2u | RESERVED | | 0x3u | RESERVED | ——————————|

  3. The value in the Length field does NOT include L2CAP header length (4 bytes).

uint16_t dataLength

Length of the parameters in HCI packet buffer in bytes.

uint8_t packetType

HCI packet type : +___________________________________________+ | Packet Type | Value | |_______________________________|___________| | HCI Command packet type | 0x1 | | HCI ACL data packet type | 0x2 | | HCI Synchronous packet type | 0x3 | | HCI Event packet type | 0x4 | +—————————-|——–+.

Note: HCI Synchronous packet type (0x3) HCI packets are not supported by PSoC 6 BLE

struct cy_stc_ble_bd_addrs_t
#include <cy_ble_stack_host_main.h>

Bluetooth Device Addresses.

Public Members

uint8_t *publicBdAddr

Public Bluetooth device address of size 6 bytes in little endian format.

uint8_t *privateBdAddr

Private Bluetooth device address of size 6 bytes in little endian format.

struct cy_stc_ble_conn_handle_t
#include <cy_ble_stack_host_main.h>

Connection Handle.

Public Members

uint8_t bdHandle

Identifies the peer device(s) bonded or currently connected.

The BLE Stack supports CY_BLE_GAP_MAX_BONDED_DEVICE+CY_BLE_MAX_CONNECTION_INSTANCES devices. First device connected is assigned value (CY_BLE_GAP_MAX_BONDED_DEVICE +CY_BLE_MAX_CONNECTION_INSTANCES)-1. If one device is present in the Bonded Devices List, then the current device will be assigned the value (CY_BLE_GAP_MAX_BONDED_DEVICE+CY_BLE_MAX_CONNECTION_INSTANCES)-2, otherwise (CY_BLE_GAP_MAX_BONDED_DEVICE+CY_BLE_MAX_CONNECTION_INSTANCES)-1.

uint8_t attId

Identifies the active ATT connection Instance.

struct cy_stc_ble_stack_flash_param_t
#include <cy_ble_stack_host_main.h>

Store BLE Application Data parameter into flash.

Public Members

uint8_t bitField

Bit field to specify the type of list to be stored in flash CY_BLE_PERSISTENT_BOND_LIST_BITMASK - B0 Bond List Data CY_BLE_PERSISTENT_RPA_LIST_BITMASK - B1 Resolving List Data CY_BLE_PERSISTENT_WHITELIST_BITMASK - B2 White List Data Bit B3 is internally used by the BLE Stack and other bits are reserved for future use.

struct cy_stc_ble_timer_info_t
#include <cy_ble_stack_host_main.h>

Timer parameter.

Public Members

uint8_t timerHandle

Handle of the started timer.

uint8_t timeout

Timeout value for new timer.

If bit 7 is 1 then bits [6:0] specify a timeout in milliseconds, otherwise seconds. This makes the assumption that no one would call timeout of, say, 32000 seconds.

struct cy_stc_ble_stack_random_num_param_t
#include <cy_ble_stack_host_main.h>

Application-specific seed for the DRBG (Deterministic Random number generator)

Public Members

uint32_t seed

Seed for DRBG.

struct cy_stc_ble_tx_pwr_config_param_t
#include <cy_ble_stack_host_main.h>

Tx power level configuration parameters.

Public Members

cy_en_ble_bless_phy_ch_grp_id_t bleSsChId

Channel group ID for which power level is to be read/written.

uint8_t bdHandle

Device handle for which power level is to be read/written.

struct cy_stc_ble_tx_pwr_lvl_info_t
#include <cy_ble_stack_host_main.h>

Tx power level parameter.

Public Members

cy_en_ble_bless_pwr_lvl_t blePwrLevel

Power level.

cy_stc_ble_tx_pwr_config_param_t pwrConfigParam

Tx power level configuration parameters.

struct cy_stc_ble_rssi_info_t
#include <cy_ble_stack_host_main.h>

RSSI parameter.

Public Members

int8_t rssi

The RSSI value Range is -85 <= N <= 5 in dBm.

uint8_t bdHandle

Peer device handle.

struct cy_stc_ble_aes_encrypt_info_t
#include <cy_ble_stack_host_main.h>

AES encrypt information.

Public Members

uint8_t plainData[CY_BLE_ENCRYPTION_DATA_SIZE]

Data containing plain text (128-bit) that is to be encrypted.

The data must be stored in little endian format.

uint8_t aesKey[CY_BLE_ENCRYPTION_KEY_SIZE]

Pointer to the AES Key (128-bit) that is to be used for AES encryption.

The key must be stored in little endian format.

struct cy_stc_ble_aes_ccm_encrypt_info_t
#include <cy_ble_stack_host_main.h>

AES CCM encrypt information.

Public Members

uint8_t key[CY_BLE_ENCRYPTION_KEY_SIZE]

Array of bytes holding the key.

The key must be stored in little endian format.

uint8_t nonce[CY_BLE_ENCRYPTION_NONCE_SIZE]

Array of bytes holding the nonce.

The nonce should be in CCM nonce format specified by the Bluetooth Core 5.0 Specification, Vol.6, Part E, Section 2.1

uint8_t *data

Pointer to an array of bytes to be encrypted.

The size of the array should be equal to the value of the ‘length’ parameter. The data must be stored in little endian format.

uint8_t length

Length of data in bytes.

struct cy_stc_ble_aes_ccm_decrypt_info_t
#include <cy_ble_stack_host_main.h>

AES CCM decrypt information.

Public Members

uint8_t key[CY_BLE_ENCRYPTION_KEY_SIZE]

Array of bytes holding the key.

The key must be stored in little endian format.

uint8_t nonce[CY_BLE_ENCRYPTION_NONCE_SIZE]

Array of bytes holding the nonce.

The nonce should be in CCM nonce format specified by the Bluetooth Core 5.0 Specification, Vol.6, Part E, Section 2.1.

uint8_t *data

Pointer to an array of bytes to be encrypted.

Size of the array should be equal to the value of the ‘length’ parameter. The data must be stored in little endian format.

uint8_t *mic

Pointer to an array of bytes (four Bytes) to provide the MIC value generated during encryption.

uint8_t length

Length of data in bytes.

struct cy_stc_ble_auth_payload_info_t
#include <cy_ble_stack_host_main.h>

Authentication payload information.

Public Members

uint16_t authPayloadTimeout

Authenticated Payload Timeout value.

This value is multiplied by 10 ms and used as the authenticated payload timeout

uint8_t bdHandle

peer device handle

struct cy_stc_ble_slave_latency_info_t
#include <cy_ble_stack_host_main.h>

Slave Latency Parameters.

Public Members

uint8_t setForceQuickTransmit

Set or reset the force quick transmit configuration in the BLE Stack.

‘1’: Set the quick transmit behavior. It gets set immediately and disables over the air slave latency. ‘0’: Reset the force quick transmit behavior in BLESS to allow the BLE Stack to control quick transmit behavior when slave latency is applied.

uint8_t bdHandle

remote device identifier

struct cy_stc_ble_set_data_length_info_t
#include <cy_ble_stack_host_main.h>

DLE Set Data Length parameter.

Public Members

uint8_t bdHandle

Peer bdHandle.

uint16_t connMaxTxOctets

The maximum number of payload octets in a Link Layer Data Channel PDU that the local Controller will send on the current connection.

uint16_t connMaxTxTime

The maximum time, in microseconds, that the local Controller will take to send a Link Layer Data Channel PDU on the current connection.

uint16_t connMaxRxOctets

The maximum number of payload octets in a Link Layer Data Channel PDU that the local Controller will receive on the current connection.

uint16_t connMaxRxTime

The maximum time, in microseconds, that the local Controller will take to receive a Link Layer Data Channel PDU on the current connection.

struct cy_stc_ble_suggested_data_length_info_t
#include <cy_ble_stack_host_main.h>

DLE Suggested Data Length parameter.

Public Members

uint16_t suggestedTxOctets

Controller’s maximum transmitted number of payload octets to be used for new connections.

uint16_t suggestedTxTime

Controller’s maximum packet transmission time, in microseconds, to be used for new connections.

struct cy_stc_ble_channel_map_info_t
#include <cy_ble_stack_host_main.h>

Channel Map Parameters Information.

Public Members

uint8_t bdHandle

Peer bdHandle.

uint8_t *channelMap

This parameter contains a five-octet byte stream in little endian format.

Least significant byte of this stream corresponds to bit fields 0 to 7 and the most significant byte of this stream corresponds to bit fields 32 to 36. The nth bit field (in the range 0 to 36) contains the value for the link layer channel index n. Allowed values and their interpretation are,

  • 0x00u - Channel ‘n’ is bad.

  • 0x01u - Channel ‘n’ is unknown. The most significant bits (37 to 39) are reserved and will be set to 0. At least one channel will be marked as unknown. For example-

  • expected byte stream = XX XX XX XX 1F

  • not expected byte stream = XX XX XX XX 10, XX XX XX XX 2f MSB 3 bits should be not set. (1F is most significant byte in this case)

struct cy_stc_ble_resolving_device_info_t
#include <cy_ble_stack_host_main.h>

Resolving List information of one device.

Public Members

uint8_t peerIrk[CY_BLE_IRK_SIZE]

Peer IRK.

uint8_t localIrk[CY_BLE_IRK_SIZE]

Local IRK.

uint8_t bdAddr[CY_BLE_BD_ADDR_SIZE]

Peer Identity device address.

uint8_t type

Peer Identity addr type.

struct cy_stc_ble_privacy_mode_info_t
#include <cy_ble_stack_host_main.h>

Configuration Structure for Set Privacy Mode.

Public Members

uint8_t bdAddr[CY_BLE_BD_ADDR_SIZE]

Peer Identity device address.

uint8_t type

Peer Identity addr type.

cy_en_ble_privacy_mode_t privacyMode

Privacy Mode.

struct cy_stc_ble_peer_id_addr_t
#include <cy_ble_stack_host_main.h>

Random number generated from the BLE Stack.

Public Members

uint8_t type

public = 0, Random = 1

uint8_t bdAddr[CY_BLE_BD_ADDR_SIZE]

Bluetooth device address.

struct cy_stc_ble_set_phy_info_t
#include <cy_ble_stack_host_main.h>

Set PHY parameter.

Public Members

uint8_t bdHandle

Peer bdHandle.

cy_en_ble_phy_no_pref_mask_t allPhyMask

Host preference for PHY setting.

Non preferred PHY settings are ignored by the controller

cy_en_ble_phy_mask_t txPhyMask

The transmitter PHY for the connection.

LE Coded PHY is not supported by PSoC 6 BLE. The valid options for txPhyMask are Cy_BLE_PHY_MASK_LE_1M and CY_BLE_PHY_MASK_LE_2M.

cy_en_ble_phy_mask_t rxPhyMask

The receiver PHY for the connection.

LE Coded PHY is not supported by PSoC 6 BLE. The valid options for txPhyMask are Cy_BLE_PHY_MASK_LE_1M and CY_BLE_PHY_MASK_LE_2M.

uint16_t phyOption

Parameter to specify coding preference.

LE Coded PHY is not supported by PSoC 6 BLE. This parameter must be ignored.

struct cy_stc_ble_set_suggested_phy_info_t
#include <cy_ble_stack_host_main.h>

Set Default PHY parameter.

Public Members

cy_en_ble_phy_no_pref_mask_t allPhyMask

Host preference for PHY setting.

Non preferred PHY settings are ignored by the controller

cy_en_ble_phy_mask_t txPhyMask

The transmitter PHY for the connection.

cy_en_ble_phy_mask_t rxPhyMask

The receiver PHY for the connection.

struct cy_stc_ble_data_length_param_t
#include <cy_ble_stack_host_main.h>

Local suggested or Max ‘tx octets’ and ‘tx time’.

Public Members

uint16_t suggestedTxOctets

Controller’s maximum transmitted number of payload octets to be used for new connections.

uint16_t suggestedTxTime

Controller’s maximum packet transmission time, in microseconds, to be used for new connections.

uint16_t maxTxOctets

Maximum number of payload octets that the local Controller supports for transmission of a single Link Layer Data Channel PDU.

uint16_t maxTxTime

Maximum time, in microseconds, that the local Controller supports for transmission of a single Link Layer Data Channel PDU.

uint16_t maxRxOctets

Maximum number of payload octets that the local Controller supports for reception of a single Link Layer Data Channel PDU.

uint16_t maxRxTime

Maximum time, in microseconds, that the local Controller supports for reception of a single Link Layer Data Channel PDU.

struct cy_stc_ble_data_length_change_event_param_t
#include <cy_ble_stack_host_main.h>

BLE Data Length Change event parameter.

Public Members

uint16_t connMaxTxOctets

The maximum number of payload octets in a Link Layer Data Channel PDU that the local Controller will send on the current connection.

uint16_t connMaxTxTime

The maximum time, in microseconds, that the local Controller will take to send a Link Layer Data Channel PDU on the current connection.

uint16_t connMaxRxOctets

The maximum number of payload octets in a Link Layer Data Channel PDU that the local controller expects to receive on the current connection.

uint16_t connMaxRxTime

The maximum time, in microseconds, that the local Controller expects to take to receive a Link Layer Data Channel PDU on this connection.

uint8_t bdHandle

Peer bdHandle.

struct cy_stc_ble_memory_request_t
#include <cy_ble_stack_host_main.h>

Memory request parameters.

Public Members

cy_en_ble_protocol_req_t request

Protocol Request type.

void *configMemory

This is an output parameter that the application must fill and pass to the BLE Stack as per the below table:

request

memory

CY_BLE_PREPARED_WRITE_REQUEST

cy_stc_ble_prepare_write_request_memory_t

uint8_t allocFree

The event parameter is generated to allocate memory or to free up previously allocated memory CY_BLE_ALLOC_MEMORY (0) = to allocate memory for request type, CY_BLE_FREE_MEMORY (1) = free previously allocated memory for the request type.

cy_stc_ble_conn_handle_t connHandle

Connection handle.

struct cy_stc_ble_aes_ccm_param_t
#include <cy_ble_stack_host_main.h>

AES CCM encrypted data information.

Public Members

uint8_t mic[CY_BLE_MIC_SIZE]

MIC value generated during encryption.

uint8_t *data

Pointer to an array of size ‘length’ where the encrypted/decrypted data is stored.

uint8_t length

length of data

struct cy_stc_ble_timeout_param_t
#include <cy_ble_stack_host_main.h>

Timeout event parameter.

Public Members

cy_en_ble_to_reason_code_t reasonCode

Reason for Timeout.

cy_stc_ble_conn_handle_t connHandle

Connection Handle.

uint8_t bdHandle
union cy_stc_ble_timeout_param_t::[anonymous] CY_BLE_HANDLE

handle

uint8_t timerHandle

Handle of the started timer.

struct cy_stc_ble_events_param_generic_t
#include <cy_ble_stack_host_main.h>

Generic Event parameter structure.

Public Members

uint8_t status

HCI error code as defined in Bluetooth 5.0 core specification, Volume 2, Part D, section 1.3.

void *eventParams

Event Parameter associated to event.

struct cy_stc_ble_phy_param_t
#include <cy_ble_stack_host_main.h>

Set PHY parameter.

Public Members

uint8_t bdHandle

Peer bdHandle.

cy_en_ble_phy_mask_t txPhyMask

The transmitter PHY for the connection.

cy_en_ble_phy_mask_t rxPhyMask

The receiver PHY for the connection.

struct cy_stc_ble_ll_cntrl_proc_param_t
#include <cy_ble_stack_host_main.h>

LL control procedure param structure.

Public Members

uint8_t bdHandle

Peer bdHandle.

uint8_t cntrlProcStatus

LL Control procedure status: pending = 1, not pending = 0.

struct cy_stc_ble_white_list_t
#include <cy_ble_stack_host_main.h>

White List information param.

Public Members

uint8_t type

Peer ID Address type, public = 0, Random = 1.

uint8_t bdAddr[CY_BLE_BD_ADDR_SIZE]

Peer ID Address.

struct cy_stc_ble_white_list_retention_t
#include <cy_ble_stack_host_main.h>

White List retention structure.

Public Members

uint8_t size

Size of the White List array elements.

const cy_stc_ble_white_list_t *whiteList

Pointer to White List Array.

struct cy_stc_ble_rpa_list_info_t
#include <cy_ble_stack_host_main.h>

Resolving List information param.

Public Members

uint16_t flags

Internally used by the BLE Stack.

uint16_t extendedFlags

Internally used by the BLE Stack.

uint8_t bdAddr[CY_BLE_BD_ADDR_SIZE]

Peer ID Address.

uint8_t type

Peer ID Address type, public = 0, Random = 1.

uint8_t localIrk[CY_BLE_IRK_SIZE]

Local IRK in little endian format.

uint8_t peerIrk[CY_BLE_IRK_SIZE]

Peer IRK in little endian format.

struct cy_stc_ble_resolving_list_retention_t
#include <cy_ble_stack_host_main.h>

Resolving List retention structure.

Public Members

uint8_t size

Size of Resolving List array elements.

cy_stc_ble_rpa_list_info_t *resolvingList

Pointer to Resolving List Array.