GAP

group group_ble_common_api_gap_definitions

Contains the GAP specific definitions and data structures used in the GAP APIs.

Typedefs

typedef void (*cy_ble_callback_t)(uint32_t eventCode, void *eventParam)

The event callback function prototype to receive events from the PSoC 6 BLE Middleware.

typedef void (*cy_ble_app_notify_callback_t)(void)

Application Notify Callback.

typedef cy_stc_ble_bd_addr_t cy_stc_ble_gap_bd_addr_t

BD Address of device.

Enums

enum cy_en_ble_state_t

cy_en_ble_state_t: BLE state machine type.

Values:

enumerator CY_BLE_STATE_STOPPED

BLE is turned off.

enumerator CY_BLE_STATE_INITIALIZING

Initializing state.

enumerator CY_BLE_STATE_ON

BLE is turned on.

enumerator CY_BLE_STATE_CONNECTING

Connecting.

enum cy_en_ble_scan_state_t

cy_en_ble_scan_state_t: Scanning state machine type.

Values:

enumerator CY_BLE_SCAN_STATE_STOPPED

Scanning is stopped.

enumerator CY_BLE_SCAN_STATE_SCAN_INITIATED

Scanning is initiated.

enumerator CY_BLE_SCAN_STATE_SCANNING

Scanning process.

enumerator CY_BLE_SCAN_STATE_STOP_INITIATED

Stop scanning is initiated.

enum cy_en_ble_adv_state_t

cy_en_ble_adv_state_t: Advertising state machine type.

Values:

enumerator CY_BLE_ADV_STATE_STOPPED

Advertising is stopped.

enumerator CY_BLE_ADV_STATE_ADV_INITIATED

Advertising is initiated.

enumerator CY_BLE_ADV_STATE_ADVERTISING

Advertising process.

enumerator CY_BLE_ADV_STATE_STOP_INITIATED

Stop advertising is initiated.

enum cy_en_ble_conn_state_t

cy_en_ble_conn_state_t: Connection state machine type.

Values:

enumerator CY_BLE_CONN_STATE_DISCONNECTED

Essentially idle state.

enumerator CY_BLE_CONN_STATE_CLIENT_DISCONNECTED_DISCOVERED

Server is disconnected but discovered.

enumerator CY_BLE_CONN_STATE_CONNECTED

Peer device is connected for this and following states.

enumerator CY_BLE_CONN_STATE_CLIENT_SRVC_DISCOVERING

Server services are being discovered.

enumerator CY_BLE_CONN_STATE_CLIENT_INCL_DISCOVERING

Server included services are being discovered.

enumerator CY_BLE_CONN_STATE_CLIENT_CHAR_DISCOVERING

Server Characteristics are being discovered.

enumerator CY_BLE_CONN_STATE_CLIENT_DESCR_DISCOVERING

Server char.

descriptors are being discovered

enumerator CY_BLE_CONN_STATE_CLIENT_DISCOVERED

Server is discovered.

enum cy_en_ble_gap_adv_assign_numbers_t

cy_en_ble_gap_adv_assign_numbers_t: Advertisement SIG assigned numbers.

Values:

enumerator CY_BLE_GAP_ADV_FLAGS

Flags.

enumerator CY_BLE_GAP_ADV_INCOMPL_16UUID

Incomplete List of 16-bit Service Class UUIDs.

enumerator CY_BLE_GAP_ADV_COMPL_16UUID

Complete List of 16-bit Service Class UUIDs.

enumerator CY_BLE_GAP_ADV_INCOMPL_32_UUID

Incomplete List of 32-bit Service Class UUIDs.

enumerator CY_BLE_GAP_ADV_COMPL_32_UUID

Complete List of 32-bit Service Class UUIDs.

enumerator CY_BLE_GAP_ADV_INCOMPL_128_UUID

Incomplete List of 128-bit Service Class UUIDs.

enumerator CY_BLE_GAP_ADV_COMPL_128_UUID

Complete List of 128-bit Service Class UUIDs.

enumerator CY_BLE_GAP_ADV_SHORT_NAME

Shortened Local Name.

enumerator CY_BLE_GAP_ADV_COMPL_NAME

Complete Local Name.

enumerator CY_BLE_GAP_ADV_TX_PWR_LVL

Tx Power Level.

enumerator CY_BLE_GAP_ADV_CLASS_OF_DEVICE

Class of Device.

enumerator CY_BLE_GAP_ADV_SMPL_PAIR_HASH_C

Simple Pairing Hash C.

enumerator CY_BLE_GAP_ADV_SMPL_PAIR_RANDOM_R

Simple Pairing Randomizer R.

enumerator CY_BLE_GAP_ADV_DEVICE_ID

Device ID.

enumerator CY_BLE_GAP_ADV_SCRT_MNGR_TK_VAL

Security Manager TK Value.

enumerator CY_BLE_GAP_ADV_SCRT_MNGR_OOB_FLAGS

Security Manager Out of Band Flags.

enumerator CY_BLE_GAP_ADV_SLAVE_CONN_INTRV_RANGE

Slave Connection Interval Range.

enumerator CY_BLE_GAP_ADV_SOLICIT_16UUID

List of 16-bit Service Solicitation UUIDs.

enumerator CY_BLE_GAP_ADV_SOLICIT_128UUID

List of 128-bit Service Solicitation UUIDs.

enumerator CY_BLE_GAP_ADV_SRVC_DATA_16UUID

Service Data - 16-bit UUID.

enumerator CY_BLE_GAP_ADV_PUBLIC_TARGET_ADDR

Public Target Address.

enumerator CY_BLE_GAP_ADV_RANDOM_TARGET_ADDR

Random Target Address.

enumerator CY_BLE_GAP_ADV_APPEARANCE

Appearance.

enumerator CY_BLE_GAP_ADV_ADVERT_INTERVAL

Advertising Interval.

enumerator CY_BLE_GAP_ADV_LE_BT_DEVICE_ADDR

LE Bluetooth Device Address.

enumerator CY_BLE_GAP_ADV_LE_ROLE

LE Role.

enumerator CY_BLE_GAP_ADV_SMPL_PAIR_HASH_C256

Simple Pairing Hash C-256.

enumerator CY_BLE_GAP_ADV_SMPL_PAIR_RANDOM_R256

Simple Pairing Randomizer R-256.

enumerator CY_BLE_GAP_ADV_SOLICIT_32UUID

List of 32-bit Service Solicitation UUIDs.

enumerator CY_BLE_GAP_ADV_SRVC_DATA_32UUID

Service Data - 32-bit UUID.

enumerator CY_BLE_GAP_ADV_SRVC_DATA_128UUID

Service Data - 128-bit UUID.

enumerator CY_BLE_GAP_ADV_3D_INFO_DATA

3D Information Data

enumerator CY_BLE_GAP_ADV_MANUFACTURER_SPECIFIC_DATA

Manufacturer Specific Data.

enum cy_en_ble_gap_sec_level_t

cy_en_ble_gap_sec_level_t: Security Levels.

Values:

enumerator CY_BLE_GAP_SEC_LEVEL_1

Level 1 Mode 1 - No security (No authentication and no encryption)

enumerator CY_BLE_GAP_SEC_LEVEL_2

Level 2 Mode 1 - Unauthenticated pairing with encryption (No MITM) Mode 2 - Unauthenticated pairing with data signing (No MITM)

enumerator CY_BLE_GAP_SEC_LEVEL_3

Level 3 Mode 1 - Authenticated pairing with encryption (With MITM) Mode 2 - Authenticated pairing with data signing (With MITM)

enumerator CY_BLE_GAP_SEC_LEVEL_4

Level 4 Secured Connection.

enumerator CY_BLE_GAP_SEC_LEVEL_MASK

LE Security Level Mask.

enum cy_en_ble_gap_iocap_t

cy_en_ble_gap_iocap_t: IO capability.

Values:

enumerator CY_BLE_GAP_IOCAP_DISPLAY_ONLY

Platform supports only a mechanism to display or convey only a 6-digit number to the user.

enumerator CY_BLE_GAP_IOCAP_DISPLAY_YESNO

The device has a mechanism whereby the user can indicate ‘yes’ or ‘no’.

enumerator CY_BLE_GAP_IOCAP_KEYBOARD_ONLY

Platform supports a numeric keyboard that can input the numbers ‘0’ through ‘9’ and a confirmation key(s) for ‘yes’ and ‘no’.

enumerator CY_BLE_GAP_IOCAP_NOINPUT_NOOUTPUT

Platform does not have the ability to display or communicate a 6 digit decimal number.

enumerator CY_BLE_GAP_IOCAP_KEYBOARD_DISPLAY

Platform supports a mechanism through which 6 digit numeric value can be displayed and numeric keyboard that can input the numbers ‘0’ through ‘9’.

enum cy_en_ble_gap_auth_failed_reason_t

cy_en_ble_gap_auth_failed_reason_t: Authentication Failed Error Codes.

Values:

enumerator CY_BLE_GAP_AUTH_ERROR_NONE

No Error.

enumerator CY_BLE_GAP_AUTH_ERROR_PASSKEY_ENTRY_FAILED

User input of passkey failed.

For example, the user cancelled the operation.

enumerator CY_BLE_GAP_AUTH_ERROR_OOB_DATA_NOT_AVAILABLE

Out Of Band data is not available.

Applicable if NFC is supported.

enumerator CY_BLE_GAP_AUTH_ERROR_AUTHENTICATION_REQ_NOT_MET

Pairing procedure cannot be performed as authentication requirements cannot be met due to IO capabilities of one or both devices.

enumerator CY_BLE_GAP_AUTH_ERROR_CONFIRM_VALUE_NOT_MATCH

Confirm value does not match the calculated compare value.

enumerator CY_BLE_GAP_AUTH_ERROR_PAIRING_NOT_SUPPORTED

Pairing is not supported by the device.

enumerator CY_BLE_GAP_AUTH_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE

Insufficient key size for the security requirements of this device, or if LTK is lost.

enumerator CY_BLE_GAP_AUTH_ERROR_COMMAND_NOT_SUPPORTED

Command received is not supported.

enumerator CY_BLE_GAP_AUTH_ERROR_UNSPECIFIED_REASON

Pairing failed due to an unspecified reason.

enumerator CY_BLE_GAP_AUTH_ERROR_REPEATED_ATTEMPTS

Pairing or authentication procedure is disallowed because too little time has elapsed since the last pairing request or security request.

enumerator CY_BLE_GAP_AUTH_ERROR_INVALID_PARAMETERS

Invalid Parameters in Request - Invalid Command length and Parameter value outside range.

enumerator CY_BLE_GAP_AUTH_ERROR_DHKEY_CHECK_FAILED

Indicates to the remote device that the DHKey Check value received does not match the one calculated by the local device.

enumerator CY_BLE_GAP_AUTH_ERROR_NUMERIC_COMPARISON_FAILED

Indicates that the confirm values in the numeric comparison protocol do not match.

enumerator CY_BLE_GAP_AUTH_ERROR_BR_EDR_PAIRING_IN_PROGRESS

Indicates that the pairing over the LE transport failed due to a Pairing Request sent over the BR/EDR transport is in process.

enumerator CY_BLE_GAP_AUTH_ERROR_CROSS_TRANSPORT_KEY_GEN_DER_NOT_ALLOWED

Indicates that the BR/EDR Link Key generated on the BR/EDR transport cannot be used to derive and distribute keys for LE transport.

enumerator CY_BLE_GAP_AUTH_ERROR_AUTHENTICATION_TIMEOUT

Authentication process timeout - if pairing timeout happens for the first time, the application can choose to re-initiate the pairing procedure.

If timeout occurs again, the application may choose to disconnect the peer device.

Link disconnected.

enum cy_en_ble_gap_addr_type_t

cy_en_ble_gap_addr_type_t: GAP address type.

Values:

enumerator CY_BLE_GAP_RANDOM_PRIV_NON_RESOLVABLE_ADDR

Random private non-resolvable address.

enumerator CY_BLE_GAP_RANDOM_PRIV_RESOLVABLE_ADDR

Random private resolvable address.

enumerator CY_BLE_GAP_PUBLIC_ADDR

Public address.

enumerator CY_BLE_GAP_RANDOM_STATIC_ADDR

Random static address.

enum cy_en_ble_gap_keypress_notify_type_t

cy_en_ble_gap_keypress_notify_type_t: Passkey entry notification types.

These are sent to application with the CY_BLE_EVT_GAP_KEYPRESS_NOTIFICATION event parameter.

Values:

enumerator CY_BLE_GAP_PASSKEY_ENTRY_STARTED

Passkey entry started.

enumerator CY_BLE_GAP_PASSKEY_DIGIT_ENTERED

One digit entered.

enumerator CY_BLE_GAP_PASSKEY_DIGIT_ERASED

One digit erased.

enumerator CY_BLE_GAP_PASSKEY_CLEARED

All digits cleared.

enumerator CY_BLE_GAP_PASSKEY_ENTRY_COMPLETED

Passkey entry completed.

enum cy_en_ble_gap_adv_addr_type_t

cy_en_ble_gap_adv_addr_type_t: GAP Direct advertiser address type.

Values:

enumerator CY_BLE_GAP_PUBLIC_ADDR_TYPE

Public device address type.

enumerator CY_BLE_GAP_RANDOM_RESOLVABLE_ADDR_TYPE

Random private resolvable address type.

enumerator CY_BLE_GAP_PUBLIC_IDENTITY_ADDR_TYPE

Public Identity address type.

enumerator CY_BLE_GAP_RANDOM_IDENTITY_ADDR_TYPE

Random static Identity Address.

enum cy_en_ble_gapc_adv_event_t

cy_en_ble_gapc_adv_event_t: Advertisement event type.

Values:

enumerator CY_BLE_GAPC_CONN_UNDIRECTED_ADV

Connectable undirected advertising.

enumerator CY_BLE_GAPC_CONN_DIRECTED_ADV

Connectable directed advertising.

enumerator CY_BLE_GAPC_SCAN_UNDIRECTED_ADV

Scannable undirected advertising.

enumerator CY_BLE_GAPC_NON_CONN_UNDIRECTED_ADV

Non connectable undirected advertising.

enumerator CY_BLE_GAPC_SCAN_RSP

Scan Response.

enum cy_en_ble_gapp_adv_t

cy_en_ble_gapp_adv_t: Advertisement type.

Values:

enumerator CY_BLE_GAPP_CONNECTABLE_UNDIRECTED_ADV

Connectable undirected advertising.

enumerator CY_BLE_GAPP_CONNECTABLE_HIGH_DC_DIRECTED_ADV

Connectable high duty cycle directed advertising.

enumerator CY_BLE_GAPP_SCANNABLE_UNDIRECTED_ADV

Scannable undirected advertising.

enumerator CY_BLE_GAPP_NON_CONNECTABLE_UNDIRECTED_ADV

Non connectable undirected advertising.

enumerator CY_BLE_GAPP_CONNECTABLE_LOW_DC_DIRECTED_ADV

Connectable low duty cycle directed advertising.

struct cy_stc_ble_gaps_t
#include <>

Structure with Generic Access Profile Service (GAPS) attribute handles.

Public Members

cy_ble_gatt_db_attr_handle_t serviceHandle

Service Handle.

cy_ble_gatt_db_attr_handle_t deviceNameCharHandle

Handle of the GAPS Device Name Characteristic.

cy_ble_gatt_db_attr_handle_t appearanceCharHandle

Handle of the GAPS Appearance Characteristic.

cy_ble_gatt_db_attr_handle_t prefConnParamCharHandle

Handle of the GAPS Peripheral Preferred Connection Parameters Characteristic.

cy_ble_gatt_db_attr_handle_t centralAddrResolutionCharHandle

Handle of the GAPS Central Address Resolution Characteristic.

cy_ble_gatt_db_attr_handle_t resolvablePrivateAddressOnly

Handle of the GAPS Resolvable Private Address Only Characteristic.

struct cy_stc_ble_gapc_t
#include <>

GAP Service Characteristics server’s GATT DB handles structure type.

Public Members

cy_ble_gatt_db_attr_handle_t deviceNameCharHandle

Handle of the GAPS Device Name Characteristic.

cy_ble_gatt_db_attr_handle_t appearanceCharHandle

Handle of the GAPS Appearance Characteristic.

cy_ble_gatt_db_attr_handle_t periphPrivacyCharHandle

Handle of the GAPS Peripheral Privacy Flag Parameters Characteristic.

cy_ble_gatt_db_attr_handle_t reconnAddrCharHandle

Handle of the GAPS Reconnection Address Characteristic.

cy_ble_gatt_db_attr_handle_t prefConnParamCharHandle

Handle of the GAPS Peripheral Preferred Connection Parameters Characteristic.

cy_ble_gatt_db_attr_handle_t centralAddrResolutionCharHandle

Handle of the GAPS Central Address Resolution Characteristic.

cy_ble_gatt_db_attr_handle_t resolvablePrivateAddressOnly

Handle of the GAPS Resolvable Private Address Only Characteristic.

struct cy_stc_ble_gaps_config_t
#include <>

GAP Service configuration structure (server)

Public Members

cy_stc_ble_gaps_t *attrInfo

Structure with attributes information.

struct cy_stc_ble_gapc_config_t
#include <>

GAP Service Configuration structure (client)

Public Members

cy_stc_ble_gapc_t *attrInfo

Structure with Discovered Attributes Information.

uint8_t serviceDiscIdx

The Discovery Service index.

struct cy_stc_ble_gapp_adv_params_t
#include <>

GAPP advertising configuration parameters structure.

Public Members

uint16_t fastAdvIntervalMin

The minimum interval for fast advertising the data and establishing the LE Connection.

uint16_t fastAdvIntervalMax

The maximum interval for fast advertising the data and establishing the LE Connection.

uint16_t fastAdvTimeOut

The timeout value of fast advertising with fast advertising interval parameters.

uint8_t slowAdvEnable

Slow advertising enable.

uint16_t slowAdvIntervalMin

The minimum interval for slow advertising the data and establishing the LE Connection.

uint16_t slowAdvIntervalMax

The maximum interval for slow advertising the data and establishing the LE Connection.

uint16_t slowAdvTimeOut

The timeout value of slow advertising with slow advertising interval parameters.

struct cy_stc_ble_gapc_scan_params_t
#include <>

GAPC advertising configuration parameters structure.

Public Members

uint16_t fastScanInterval

The scan interval when operating in Fast connection.

uint16_t fastScanWindow

Defines the scan window when operating in Fast connection.

uint16_t fastScanTimeOut

The timeout value of scanning with fast scan parameters.

uint8_t slowScanEnabled

Slow scan enable/disable.

uint16_t slowScanInterval

The scan interval when operating in Slow connection.

uint16_t slowScanWindow

Defines the scan window when operating in Slow connection.

uint16_t slowScanTimeOut

The timeout value of scanning with Slow scan parameters.

uint16_t gapcConnectionIntervalMin

The minimum permissible connection time value to be used during a connection event.

uint16_t gapcConnectionIntervalMax

The maximum permissible connection time value to be used during a connection event.

uint16_t gapcConnectionSlaveLatency

Defines the maximum time between two received Data Packet PDUs before the connection is considered lost.

uint16_t gapcConnectionTimeOut

Defines the LE link supervision timeout interval.

struct cy_stc_ble_app_flash_param_t
#include <>

Store BLE Application Data parameter into flash.

Public Members

const uint8_t *srcBuff

Source buffer.

const uint8_t *destAddr

Destination buffer.

uint32_t buffLen

Source buffer length.

uint32_t writeMode

Write mode: blocking (default) / non-blocking.

struct cy_stc_ble_gap_oob_info_t
#include <>

Out of Band Parameters Information.

Public Members

uint8_t bdHandle

bd handle of the remote device

uint8_t oobFlag

OOB data presence flag.

Allowed value are: CY_BLE_GAP_OOB_DISABLE CY_BLE_GAP_OOB_ENABLE

uint8_t *key

16 Octet Temporary Key to be used for OOB authentication

uint8_t *oobData

Pointer to OOB data.

uint8_t oobDataLen

Length of OOB data.

struct cy_stc_ble_gap_sec_req_t
#include <>

Security requirement of local device used in strict pairing.

Public Members

uint8_t secReq

Security requirement.

uint8_t encKeySize

Encryption key size.

struct cy_stc_ble_gap_disconnect_info_t
#include <>

Disconnect command information.

Public Members

uint8_t reason

Reason for disconnection.

uint8_t bdHandle

bd handle of the remote device

struct cy_stc_ble_gap_peer_addr_info_t
#include <>

Peer Bluetooth Device Address information.

Public Members

cy_stc_ble_gap_bd_addr_t bdAddr

Bluetooth device address.

uint8_t bdHandle

bd handle of the remote device

struct cy_stc_ble_gap_sec_key_param_t
#include <>

Security keys information.

Public Members

uint8_t ltkInfo[CY_BLE_GAP_SMP_LTK_SIZE]

Long Term Key.

uint8_t midInfo[CY_BLE_GAP_SMP_MID_INFO_SIZE]

Encrypted Diversifier and Random Number.

uint8_t irkInfo[CY_BLE_GAP_SMP_IRK_SIZE]

Identity Resolving Key.

uint8_t idAddrInfo[CY_BLE_GAP_SMP_IDADDR_DATA_SIZE]

Public device/Static Random address type idAddrInfo[0] - Address Type idAddrInfo[1] to idAddrInfo[6] - Address.

uint8_t csrkInfo[CY_BLE_GAP_SMP_CSRK_SIZE]

Connection Signature Resolving Key.

uint8_t bdHandle

bd handle of the remote device

struct cy_stc_ble_gap_sec_key_info_t
#include <>

Security information.

Public Members

cy_stc_ble_gap_sec_key_param_t SecKeyParam

Security keys information parameter.

uint8_t exchangeKeysFlag

This parameter indicates which keys get exchanged with a peer device.

The following is the bit field mapping for the keys. Bit 0: Local Encryption information Bit 1: Local Identity information Bit 2: Local Signature Key Bit 3: Reserved Bit 4: Remote Encryption information Bit 5: Remote Identity information Bit 6: Remote Signature Key Bit 7: Reserved

uint8_t localKeysFlag

This parameter indicates which keys are to be set/generated in the BLE Stack.

The following is the bit field mapping for the keys. Bit 0: Local Encryption information Bit 1: Local Identity information Bit 2: Local Signature Key Bits 3-7: Reserved

struct cy_stc_ble_gap_bd_addr_info_t
#include <>

Bluetooth Device Address information.

Public Members

uint8_t irkInfo[CY_BLE_GAP_SMP_IRK_SIZE]

Identity Resolving Key.

cy_stc_ble_gap_bd_addr_t gapBdAddr

Memory for gapBdAddr.

Completion event will use this memory as output parameter.

cy_en_ble_gap_addr_type_t addrType

Device address type.

struct cy_stc_ble_gap_auth_info_t
#include <>

Authentication Parameters Information.

Public Members

uint8_t security

Security Mode setting will be value of enum cy_en_ble_gap_sec_level_t as follows: (CY_BLE_GAP_SEC_MODE_1 | CY_BLE_GAP_SEC_LEVEL_2) (CY_BLE_GAP_SEC_MODE_1 | CY_BLE_GAP_SEC_LEVEL_3) (CY_BLE_GAP_SEC_MODE_1 | CY_BLE_GAP_SEC_LEVEL_4) (CY_BLE_GAP_SEC_MODE_2 | CY_BLE_GAP_SEC_LEVEL_2) (CY_BLE_GAP_SEC_MODE_2 | CY_BLE_GAP_SEC_LEVEL_3)

uint8_t bonding

Bonding type setting: CY_BLE_GAP_BONDING_NONE CY_BLE_GAP_BONDING.

uint8_t ekeySize

Encryption Key Size (octets) Minimum = 7 maximum = 16 For a slave initiated security request, this parameter must be ignored.

cy_en_ble_gap_auth_failed_reason_t authErr

Parameter to say whether authentication is accepted or rejected with a reason.

accepted = CY_BLE_GAP_AUTH_ERROR_NONE or error code cy_en_ble_gap_auth_failed_reason_t.

uint8_t pairingProperties

Bit 0: MITM (Applicable only if Secure connections) Use CY_BLE_GAP_SMP_SC_PAIR_PROP_MITM_MASK Bit 1: Key press (sets Key press bit in authentication requirements flags of pairing request/response.

Applicable only for secure connections) Use CY_BLE_GAP_SMP_SC_PAIR_PROP_KP_MASK Bit [2-7]: RFU

uint8_t bdHandle

Peer bdHandle.

struct cy_stc_ble_gap_auth_pk_info_t
#include <>

Authentication Passkey Information.

Public Members

uint32_t passkey

6-digit decimal number (authentication passkey)

uint8_t accept

Accept or reject passkey entry request.

Allowed values are, CY_BLE_GAP_REJECT_PASSKEY_REQ CY_BLE_GAP_ACCEPT_PASSKEY_REQ

uint8_t bdHandle

bdHandle

struct cy_stc_ble_gap_auth_fix_pk_info_t
#include <>

Fixed Passkey Parameters Information.

Public Members

uint32_t fixedPassKey

6-digit decimal number (<=999999).

This is used only if isFixed is set to CY_BLE_GAP_PASSKEY_FIXED, else ignored

uint8_t bdHandle

Peer bdHandle.

uint8_t isFixed

Passkey is fixed application, CY_BLE_GAP_PASSKEY_FIXED: ‘fixedPassKey’ will be used by the BLE Stack that is provided by the application.

CY_BLE_GAP_PASSKEY_NOT_FIXED: ‘fixedPassKey’ will be ignored and the BLE Stack will generate as per security procedure.

struct cy_stc_ble_gap_conn_update_param_info_t
#include <>

GAP Connection Update parameters.

Public Members

uint16_t connIntvMin

Minimum value for the connection event interval.

This shall be less than or equal to conn_Interval_Max. Minimum connection interval will be connIntvMin * 1.25 ms Time Range: 7.5 ms to 4 sec

uint16_t connIntvMax

Maximum value for the connection event interval.

This shall be greater than or equal to conn_Interval_Min. Maximum connection interval will be connIntvMax * 1.25 ms Time Range: 7.5 ms to 4 sec

uint16_t connLatency

Slave latency for the connection in number of connection events.

Range: 0x0000 to 0x01F3

uint16_t supervisionTO

Supervision timeout for the LE Link.

Supervision timeout will be supervisionTO * 10 ms Time Range: 100 msec to 32 secs

uint8_t bdHandle

Peer bdHandle.

uint16_t ceLength

connection length

struct cy_stc_ble_gap_sc_mode_info_t
#include <>

Secure connection only mode parameters.

Public Members

uint8_t state

state: 0 - Disable (Device not in secure connections only mode)

1 - Enable (Device is in secure connections only mode)

struct cy_stc_ble_gap_sc_kp_notif_info_t
#include <>

Secure connection key press notification parameters.

Public Members

uint8_t bdHandle

Peer bdHandle.

cy_en_ble_gap_keypress_notify_type_t notificationType

notification type to be sent to remote identified by bdHandle

struct cy_stc_ble_gap_sc_oob_info_t
#include <>

Secure connection key press notification parameters.

Public Members

uint8_t *rand

16 Bytes Random number to be used for generating OOB data

uint8_t bdHandle

Peer bdHandle.

struct cy_stc_ble_gap_bonded_device_list_info_t
#include <>

Bluetooth Bonded Device Address list.

Public Members

cy_stc_ble_gap_peer_addr_info_t *bdHandleAddrList

Pointer to list of Bluetooth device addresses and corresponding bdHandle of bonded devices.

uint8_t noOfDevices

Number of bonded devices.

struct cy_stc_ble_gap_smp_local_p256_keys_t
#include <>

SMP P-256 public-private key pair.

Public Members

uint8_t publicKey[CY_BLE_GAP_SMP_P256_PUBLIC_KEY_SIZE]

P-256 public key.

uint8_t privateKey[CY_BLE_GAP_SMP_P256_PRIVATE_KEY_SIZE]

P-256 private key.

uint8_t isValidateKeys

If it is set to 1, the public key is validated.

If it is set to 0, public key is not validated. This parameter is not applicable for CY_BLE_EVT_GAP_GEN_SET_LOCAL_P256_KEYS_COMPLETE event.

struct cy_stc_ble_gap_ce_length_param_info_t
#include <>

GAP Connection Update parameters.

Public Members

uint16_t ceLength

connection length

uint8_t bdHandle

Peer bdHandle.

struct cy_stc_ble_gap_set_conn_priority_param_t
#include <>

GAP Connection Update parameters.

Public Members

uint8_t connPriority

Priority of the connection compared to other connection.

0x00 Highest and 0xFF lowest and default for all the connections

uint8_t bdHandle

Peer bdHandle.

struct cy_stc_ble_gap_conn_param_updated_in_controller_t
#include <>

Current Connection Parameters used by controller.

Public Members

uint8_t status

Status corresponding to this event will be the HCI error code as defined in BLE spec 4.1.

uint16_t connIntv

Connection interval used on this connection.

Range: 0x0006 to 0x0C80 Time Range: 7.5 ms to 4 sec

uint16_t connLatency

Slave latency for the connection in a number of connection events.

Range: 0x0000 to 0x01F3

uint16_t supervisionTO

Supervision timeout for the LE Link.

Supervision timeout will be supervisionTO * 10 ms Time Range: 100 msec to 32 secs

uint8_t bdHandle

bd handle of the remote device

struct cy_stc_ble_gap_connected_param_t
#include <>

Gap Connected Parameters.

Public Members

uint8_t status

status corresponding to this event will be HCI error code as defined in BLE spec 4.1

uint8_t bdHandle

bd handle of the remote device

uint8_t role

Connected as - master = CY_BLE_GAP_LL_ROLE_MASTER, Slave = CY_BLE_GAP_LL_ROLE_SLAVE.

uint8_t peerAddrType

Address type of the Bluetooth device address.

  • CY_BLE_GAP_ADDR_TYPE_PUBLIC (Public device address)

  • CY_BLE_GAP_ADDR_TYPE_RANDOM (Random device address)

uint8_t *peerAddr

Peer Bluetooth device address of size CY_BLE_BD_ADDR_SIZE.

uint16_t connIntv

Connection interval used on this connection.

Range: 0x0006 to 0x0C80 Time Range: 7.5 ms to 4 sec

uint16_t connLatency

Slave latency for the connection in number of connection events.

Range: 0x0000 to 0x01F3

uint16_t supervisionTO

Supervision timeout for the LE Link.

Supervision timeout will be supervisionTO * 10 ms Time Range: 100 msec to 32 secs

uint8_t masterClockAccuracy

Master Clock Accuracy parameter is only valid for a slave.

On a master, this parameter shall be set to 0x00.

struct cy_stc_ble_gap_oob_data_param_t
#include <>

OOB data.

Public Members

uint8_t bdHandle

Peer bdHandle.

uint8_t status

Status corresponding to this event will be HCI error code as defined in BLE spec 4.2.

uint8_t *key

Rand for OOB.

This is also stored in BLE Stack

uint8_t *oobData

OOB Data using ‘key’ and local Public Key.

uint8_t oobDataLen

Length of OOB data which is 16 Bytes for Secure connections.

struct cy_stc_ble_gap_enhance_conn_complete_param_t
#include <>

Current Connection Parameters used by controller.

Public Members

uint16_t connIntv

Connection interval used on this connection.

Range: 0x0006 to 0x0C80 Time Range: 7.5 ms to 4 sec

uint16_t connLatency

Slave latency for the connection in number of connection events.

Range: 0x0000 to 0x01F3

uint16_t supervisionTo

Supervision timeout for the LE Link.

Supervision timeout will be supervisionTO * 10 ms Time Range: 100 msec to 32 secs

uint8_t *peerBdAddr

Peer Device Address.

cy_en_ble_gap_adv_addr_type_t peerBdAddrType

Peer Device Address type.

uint8_t *localResolvablePvtAddr

Local Resolvable Private Address Resolvable Private Address being used by the local device for this connection.

This is valid only when the Own_Address_Type in connection/advertisement parameters is set to 0x02 or 0x03. For other Own_Address_Type values, this will be all zeros.

uint8_t *peerResolvablePvtAddr

Peer Resolvable Private Address Resolvable Private Address being used by the peer device for this connection.

This is valid only for the Peer_Address_Type 0x02 or 0x03. For other Peer_Address_Type values, this will be all zeros.

uint8_t role

Connected as - master = CY_BLE_GAP_LL_ROLE_MASTER, Slave = CY_BLE_GAP_LL_ROLE_SLAVE.

uint8_t masterClockAccuracy

Master clock accuracy 0x00 -> 500 ppm 0x01 -> 250 ppm 0x02 -> 150 ppm 0x03 -> 100 ppm 0x04 -> 75 ppm 0x05 -> 50 ppm 0x06 -> 30 ppm 0x07 -> 20 ppm.

uint8_t status

Status corresponding to this event will be HCI error code.

Values of 0 indicates connection successfully completed. Refer BLE spec 4.2,Vol2, Part D for Error codes.

uint8_t bdHandle

bd handle of the remote device

struct cy_stc_ble_gap_disconnect_param_t
#include <>

Disconnection Parameters.

Public Members

uint8_t status

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

uint8_t bdHandle

Peer bdHandle.

uint8_t reason

Reason for disconnection.

struct cy_stc_ble_gap_encrypt_change_param_t
#include <>

Encryption Change Parameters.

Public Members

uint8_t bdHandle

Peer bdHandle.

uint8_t encryption

Encryption change event for active connection.

‘evParam’ can be decoded as encryption = CY_BLE_GAP_ENCRYPT_OFF -> Encryption OFF encryption = CY_BLE_GAP_ENCRYPT_ON -> Encryption ON

struct cy_stc_ble_gapc_disc_info_t
#include <>

Discovery (scan) parameter.

Public Members

uint8_t discProcedure

Observation and discovery procedure.

  • CY_BLE_GAPC_OBSER_PROCEDURE (Observation procedure)

  • CY_BLE_GAPC_LTD_DISC_PROCEDURE (Limited discovery procedure)

  • CY_BLE_GAPC_GEN_DISC_PROCEDURE (General discovery procedure)

uint8_t scanType

Type of scan to perform.

  • CY_BLE_GAPC_PASSIVE_SCANNING (Passive Scanning)

  • CY_BLE_GAPC_ACTIVE_SCANNING (Active scanning)

uint16_t scanIntv

The time interval from when last LE scan is started until next subsequent LE scan.

Range: 0x0004 to 0x4000 Unit: 0.625 msec Time Range: 2.5 ms to 10.24 sec.

uint16_t scanWindow

The time duration of scanning to be performed Range: 0x0004 to 0x4000 Unit: 0.625 msec Time Range: 2.5 ms to 10.24 sec.

uint8_t ownAddrType

Own BD Address Type.

  • CY_BLE_GAP_ADDR_TYPE_PUBLIC

  • CY_BLE_GAP_ADDR_TYPE_RANDOM

  • CY_BLE_GAP_ADDR_TYPE_PUBLIC_RPA

  • CY_BLE_GAP_ADDR_TYPE_RANDOM_RPA

uint8_t scanFilterPolicy

Filter policies to be applied during scanning procedure.

  • CY_BLE_GAPC_ADV_ACCEPT_ALL_PKT

  • CY_BLE_GAPC_ADV_ACCEPT_WHITELIST_PKT

  • CY_BLE_GAPC_ADV_ACCEPT_DIRECTED_RPA_PKT

  • CY_BLE_GAPC_ADV_ACCEPT_WHITELIST_DIRECTED_RPA_PKT

uint16_t scanTo

Scan time out is in seconds.

If time out is set to 0, then there will not be any time out.

uint8_t filterDuplicates

Filter Duplicate Advertisements.

This parameter controls whether the Link Layer shall filter duplicate advertising reports to the Host, or whether the Link Layer should generate advertising reports for each packet received.

  • CY_BLE_GAPC_FILTER_DUP_DISABLE (Duplicate filtering disabled)

  • CY_BLE_GAPC_FILTER_DUP_ENABLE (Duplicate filtering enabled)

By default, duplicate filtering is enabled

struct cy_stc_ble_gapc_conn_info_t
#include <>

Connection parameter.

Public Members

uint16_t scanIntv

The time interval from when last LE scan is started until next subsequent LE scan.

  • Time Range: 2.5 ms to 10.24 sec.

uint16_t scanWindow

The time duration of scanning to be performed.

  • Time Range: 2.5 ms to 10.24 sec

uint8_t initiatorFilterPolicy

Filter policies to be applied during connection procedure.

  • CY_BLE_GAPC_CONN_ALL (White List is not used to determine with which advertiser to connect. Peer address is used)

  • CY_BLE_GAPC_CONN_WHITELIST (White List is used to determine with which advertiser to connect. Peer address shall be ignored)

uint8_t peerBdAddr[CY_BLE_GAP_BD_ADDR_SIZE]

Peer’s BD address with which connection is to be established.

BD address should be in Little Endian format.

uint8_t peerAddrType

Peer’s BD address type.

  • CY_BLE_GAP_ADDR_TYPE_PUBLIC

  • CY_BLE_GAP_ADDR_TYPE_RANDOM

  • CY_BLE_GAP_ADDR_TYPE_PUBLIC_RPA

  • CY_BLE_GAP_ADDR_TYPE_RANDOM_RPA

uint8_t ownAddrType

Own BD address type.

  • CY_BLE_GAP_ADDR_TYPE_PUBLIC

  • CY_BLE_GAP_ADDR_TYPE_RANDOM

  • CY_BLE_GAP_ADDR_TYPE_PUBLIC_RPA

  • CY_BLE_GAP_ADDR_TYPE_RANDOM_RPA

uint16_t connIntvMin

Minimum value for the connection event interval.

This shall be less than or equal to conn_Interval_Max. Minimum connection interval will be connIntvMin * 1.25 ms Time Range: 7.5 ms to 4 sec

uint16_t connIntvMax

Maximum value for the connection event interval.

This shall be greater than or equal to conn_Interval_Min. Maximum connection interval will be connIntvMax * 1.25 ms Time Range: 7.5 ms to 4 sec

uint16_t connLatency

Slave latency for the connection in number of connection events.

Range: 0x0000 to 0x01F3

uint16_t supervisionTO

Supervision time out for the LE Link.

Supervision time out will be supervisionTO * 10 ms Time Range: 100 msec to 32 secs

uint16_t minCeLength

Minimum length of connection needed for this LE connection.

Range: 0x0000 - 0xFFFF

uint16_t maxCeLength

Maximum length of connection needed for this LE connection.

Range: 0x0000 - 0xFFFF

struct cy_stc_ble_gapc_resolve_peer_info_t
#include <>

Resolve peer device parameter.

Public Members

uint8_t *bdAddr

Peer Bluetooth device address.

uint8_t peerIrk[CY_BLE_GAP_SMP_IRK_SIZE]

Peer IRK.

struct cy_stc_ble_gapc_peer_bd_addr_info_t
#include <>

Set peer BD Address parameter.

Public Members

cy_stc_ble_gap_bd_addr_t remoteAddr

Peer Bluetooth device address.

uint8_t bdHandle

Peer bdHandle.

struct cy_stc_ble_gapc_adv_report_param_t
#include <>

Advertisement report parameter.

Public Members

cy_en_ble_gapc_adv_event_t eventType

Advertisement event type.

  • Connectable undirected advertising = 0x00

  • Connectable directed advertising = 0x01

  • Scannable undirected advertising = 0x02

  • Non connectable undirected advertising = 0x03

  • Scan Response = 0x04

uint8_t peerAddrType

BD address type of the device advertising.

  • CY_BLE_GAP_ADDR_TYPE_PUBLIC

  • CY_BLE_GAP_ADDR_TYPE_RANDOM

  • CY_BLE_GAP_ADDR_TYPE_PUBLIC_RPA

  • CY_BLE_GAP_ADDR_TYPE_RANDOM_RPA

uint8_t *peerBdAddr

Public Device Address or Random Device Address for each device that responded to scanning.

uint8_t dataLen

length of the data for each device that responded to scanning

uint8_t *data

Pointer to advertising or scan response data.

int8_t rssi

Rssi of the responding device.

Range: -85 <= N <= 0 Units: dBm

struct cy_stc_ble_gapc_direct_adv_report_param_t
#include <>

Direct Advertising Report received by GAP Central.

Public Members

uint8_t *localBdAddr

Buffer containing Random Device Address of Scanner (local device) This is the address to which the directed advertisements are being directed.

BD address should be in Little Endian format.

uint8_t *peerBdAddr

Buffer containing Device Address of advertiser sending the directed advertisement.

cy_en_ble_gap_adv_addr_type_t peerBdAddrType

Device Address type of advertiser sending the directed advertisement.

int8_t rssi

Rssi of the responding device.

Range: -127 <= N <= +20 Units: dBm N = 127 -> RSSI not available

struct cy_stc_ble_gapp_disc_param_t
#include <>

Advertising parameters.

Public Members

uint16_t advIntvMin

Minimum advertising interval for undirected and low duty cycle directed advertising Range: 0x0020 to 0x4000 Unit: 0.625ms Time Range: 20 ms to 10.24 sec.

uint16_t advIntvMax

Maximum advertising interval for undirected and low duty cycle directed advertising.

Range: 0x0020 to 0x4000 Unit: 0.625ms Time Range: 20 ms to 10.24 sec.

cy_en_ble_gapp_adv_t advType

Type of advertisement.

  • Connectable undirected advertising (0x00)

  • Connectable high duty cycle directed advertising (0x01)

  • Scannable undirected advertising (0x02)

  • Non connectable undirected advertising (0x03)

  • Connectable low duty cycle directed advertising (0x04)

uint8_t ownAddrType

Own BD Address Type.

  • CY_BLE_GAP_ADDR_TYPE_PUBLIC

  • CY_BLE_GAP_ADDR_TYPE_RANDOM

  • CY_BLE_GAP_ADDR_TYPE_PUBLIC_RPA

  • CY_BLE_GAP_ADDR_TYPE_RANDOM_RPA

uint8_t directAddrType

Address type of the Bluetooth device address being used for directed advertising, not applicable otherwise.

  • CY_BLE_GAP_ADDR_TYPE_PUBLIC (Public device address)

  • CY_BLE_GAP_ADDR_TYPE_RANDOM (Random device address)

uint8_t directAddr[CY_BLE_GAP_BD_ADDR_SIZE]

This parameter specifies Bluetooth device address of the device to be connected while using directed advertising.

In case of none direct advertising, parameter will be 0

uint8_t advChannelMap

Advertising channels that shall be used when transmitting advertising packets.

Channel map selection:

  • Enable channel 37 = bitmask. xxxxxxx1b

  • Enable channel 38 = bitmask. xxxxxx1xb

  • Enable channel 39 = bitmask. xxxxx1xxb

uint8_t advFilterPolicy

Advertising Filter Policy.

  • CY_BLE_GAPP_SCAN_ANY_CONN_ANY (Allow Scan Request from Any, Allow Connect Request from Any (Default))

  • CY_BLE_GAPP_SCAN_WHITELIST_CONN_ANY (Allow Scan Request from White List Only, Allow Connect Request)

  • CY_BLE_GAPP_SCAN_ANY_CONN_WHITELIST (Allow Scan Request from Any, Allow Connect Request from White List Only)

  • CY_BLE_GAPP_SCAN_CONN_WHITELIST_ONLY (Allow Scan Request from White List Only, Allow Connect Request from White List Only)

struct cy_stc_ble_gapp_disc_data_t
#include <>

Advertising data.

Public Members

uint8_t advData[CY_BLE_GAP_MAX_ADV_DATA_LEN]

GAP Advertisement Parameters which includes Flags, Service UUIDs and short name.

uint8_t advDataLen

length of the advertising data.

This should be made zero if there is no data. Maximum length can be CY_BLE_GAP_MAX_ADV_DATA_LEN

struct cy_stc_ble_gapp_scan_rsp_data_t
#include <>

Scan response data.

Public Members

uint8_t scanRspData[CY_BLE_GAP_MAX_SCAN_RSP_DATA_LEN]

Static user data transmitted in scan response.

This should be made NULL if there is no data. Maximum length of the data is equal to 31 bytes

uint8_t scanRspDataLen

Length of the scan response data.

This should be made zero if there is no data. Maximum length can be CY_BLE_GAP_MAX_SCAN_RSP_DATA_LEN

struct cy_stc_ble_gapp_disc_mode_info_t
#include <>

Advertising information.

Public Members

uint8_t discMode

Broadcaster and discoverable mode.

  • CY_BLE_GAPP_NONE_DISC_BROADCAST_MODE (Applicable for Broadcaster or non-discoverable mode)

  • CY_BLE_GAPP_LTD_DISC_MODE (Limited discovery mode)

  • CY_BLE_GAPP_GEN_DISC_MODE (General discovery mode)

cy_stc_ble_gapp_disc_param_t *advParam

Advertisement parameters are not allowed to be modified if ADV is already active This needs to be NULL, if ADV is active.

cy_stc_ble_gapp_disc_data_t *advData

Advertisement data.

cy_stc_ble_gapp_scan_rsp_data_t *scanRspData

Scan Response data.

uint16_t advTo

Advertisement timeout is in seconds.

If timeout is set to 0, then there will not be any timeout. The parameter ‘advTo’ can be used for all GAP timeouts related to peripheral operation. For General discoverable mode, this timer will be ignored. The application is expected to exit from discoverable mode explicitly by calling the Cy_BLE_GAPP_ExitDiscoveryMode() API. For Limited discoverable mode, ‘advTo’ should not exceed 180 sec.