Cypress PSoC 6 Bluetooth Low Energy Middleware Library 3.60

General Description

API unique to WPTS designs configured as a GATT Client role.

A letter 'c' is appended to the API name: Cy_BLE_WPTSC_

Functions

cy_en_ble_api_result_t Cy_BLE_WPTSC_Discovery (cy_ble_gatt_db_attr_handle_t servHandle, cy_stc_ble_conn_handle_t connHandle)
 This function discovers the PRU's WPT service and characteristics using the GATT Primary service Handle, received through the WPT service Data within the PRU advertisement payload, together with the handle offsets defined A4WP specification. More...
 
cy_en_ble_api_result_t Cy_BLE_WPTSC_SetCharacteristicValue (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_wpts_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue)
 This function is used to write the characteristic (which is identified by charIndex) value attribute in the server. More...
 
cy_en_ble_api_result_t Cy_BLE_WPTSC_GetCharacteristicValue (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_wpts_char_index_t charIndex)
 This function is used to read a characteristic value, which is a value identified by charIndex, from the server. More...
 
cy_en_ble_api_result_t Cy_BLE_WPTSC_SetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_wpts_char_index_t charIndex, cy_en_ble_wpts_descr_index_t descrIndex, uint8_t attrSize, uint8_t *attrValue)
 This function is used to write the characteristic descriptor to the server, which is identified by charIndex and descrIndex. More...
 
cy_en_ble_api_result_t Cy_BLE_WPTSC_GetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_wpts_char_index_t charIndex, cy_en_ble_wpts_descr_index_t descrIndex)
 Sends a request to get the characteristic descriptor of the specified characteristic of the service. More...
 

Function Documentation

◆ Cy_BLE_WPTSC_Discovery()

cy_en_ble_api_result_t Cy_BLE_WPTSC_Discovery ( cy_ble_gatt_db_attr_handle_t  servHandle,
cy_stc_ble_conn_handle_t  connHandle 
)

This function discovers the PRU's WPT service and characteristics using the GATT Primary service Handle, received through the WPT service Data within the PRU advertisement payload, together with the handle offsets defined A4WP specification.

The PTU may perform service discovery using the Cy_BLE_GATTC_StartDiscovery(). This function may be used in response to service Changed indication or to discover services other than the WPT service supported by the PRU.

Parameters
servHandleGATT Primary service Handle of the WPT service.
connHandleBLE peer device connection handle.
Returns
A return value of type cy_en_ble_api_result_t.
Error Codes Description
CY_BLE_SUCCESS The request was handled successfully.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED All client instances are used.

◆ Cy_BLE_WPTSC_SetCharacteristicValue()

cy_en_ble_api_result_t Cy_BLE_WPTSC_SetCharacteristicValue ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_wpts_char_index_t  charIndex,
uint8_t  attrSize,
uint8_t *  attrValue 
)

This function is used to write the characteristic (which is identified by charIndex) value attribute in the server.

As a result, a Write Request is sent to the GATT Server and on successful execution of the request on the server side, the CY_BLE_EVT_WPTSS_WRITE_CHAR event is generated. On successful request execution on the server side, the Write Response is sent to the client.

Parameters
connHandleThe connection handle.
charIndexThe index of a service characteristic of type cy_en_ble_wpts_char_index_t.
attrSizeThe size of the characteristic value attribute.
attrValueThe pointer to the characteristic value data that should be send to the server device.
Returns
A return value of type cy_en_ble_api_result_t.
Error Codes Description
CY_BLE_SUCCESS The request was sent successfully.
CY_BLE_ERROR_INVALID_PARAMETER Validation of the input parameters failed.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED Memory allocation failed.
CY_BLE_ERROR_INVALID_STATE Connection with the server is not established.
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE The peer device doesn't have the particular characteristic.
CY_BLE_ERROR_INVALID_OPERATION Operation is invalid for this characteristic.
Events
In case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the WPTS service-specific callback is registered (with Cy_BLE_WPTS_RegisterAttrCallback): Otherwise (if the WPTS service-specific callback is not registered):

◆ Cy_BLE_WPTSC_GetCharacteristicValue()

cy_en_ble_api_result_t Cy_BLE_WPTSC_GetCharacteristicValue ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_wpts_char_index_t  charIndex 
)

This function is used to read a characteristic value, which is a value identified by charIndex, from the server.

Parameters
connHandleThe connection handle.
charIndexThe index of a service characteristic of type cy_en_ble_wpts_char_index_t.
Returns
A return value of type cy_en_ble_api_result_t.
Error Codes Description
CY_BLE_SUCCESS The request was sent successfully.
CY_BLE_ERROR_INVALID_PARAMETER Validation of the input parameters failed.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED Memory allocation failed.
CY_BLE_ERROR_INVALID_STATE Connection with the server is not established.
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE The peer device doesn't have the particular characteristic.
CY_BLE_ERROR_INVALID_OPERATION Operation is invalid for this characteristic.
Events
In case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the WPTS service-specific callback is registered (with Cy_BLE_WPTS_RegisterAttrCallback): Otherwise (if the WPTS service-specific callback is not registered):

◆ Cy_BLE_WPTSC_SetCharacteristicDescriptor()

cy_en_ble_api_result_t Cy_BLE_WPTSC_SetCharacteristicDescriptor ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_wpts_char_index_t  charIndex,
cy_en_ble_wpts_descr_index_t  descrIndex,
uint8_t  attrSize,
uint8_t *  attrValue 
)

This function is used to write the characteristic descriptor to the server, which is identified by charIndex and descrIndex.

Internally, Write Request is sent to the GATT Server and on successful execution of the request on the server side, the following events can be generated:

Parameters
connHandleThe connection handle.
charIndexThe index of a service characteristic of type cy_en_ble_wpts_char_index_t.
descrIndexThe index of a service characteristic descriptor of type cy_en_ble_wpts_descr_index_t.
attrSizeThe size of the characteristic value attribute.
attrValueThe pointer to the characteristic descriptor value data that should be sent to the server device.
Returns
A return value of type cy_en_ble_api_result_t.
Error Codes Description
CY_BLE_SUCCESS The request was sent successfully.
CY_BLE_ERROR_INVALID_PARAMETER Validation of the input parameters failed.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED Memory allocation failed.
CY_BLE_ERROR_INVALID_STATE The state is not valid.
CY_BLE_ERROR_INVALID_OPERATION Operation is not permitted on the specified attribute.
Events
In case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the WPTS service-specific callback is registered (with Cy_BLE_WPTS_RegisterAttrCallback): Otherwise (if the WPTS service-specific callback is not registered):

◆ Cy_BLE_WPTSC_GetCharacteristicDescriptor()

cy_en_ble_api_result_t Cy_BLE_WPTSC_GetCharacteristicDescriptor ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_wpts_char_index_t  charIndex,
cy_en_ble_wpts_descr_index_t  descrIndex 
)

Sends a request to get the characteristic descriptor of the specified characteristic of the service.

Parameters
connHandleThe connection handle.
charIndexThe index of a service characteristic of type cy_en_ble_wpts_char_index_t.
descrIndexThe index of a service characteristic descriptor of type cy_en_ble_wpts_descr_index_t.
Returns
Error Codes Description
CY_BLE_SUCCESS The request was sent successfully.
CY_BLE_ERROR_INVALID_PARAMETER Validation of the input parameters failed.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED Memory allocation failed.
CY_BLE_ERROR_INVALID_STATE The state is not valid.
CY_BLE_ERROR_INVALID_OPERATION Operation is not permitted on the specified attribute.
Events
In case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the WPTS service-specific callback is registered (with Cy_BLE_WPTS_RegisterAttrCallback): Otherwise (if the WPTS service-specific callback is not registered):