Cypress PSoC 6 Bluetooth Low Energy Middleware Library 3.60

General Description

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

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

Functions

cy_en_ble_api_result_t Cy_BLE_UDSC_SetCharacteristicValue (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_uds_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_UDSC_GetCharacteristicValue (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_uds_char_index_t charIndex)
 This function is used to read the characteristic Value from a server, as identified by its charIndex. More...
 
cy_en_ble_api_result_t Cy_BLE_UDSC_GetLongCharacteristicValue (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_uds_char_index_t charIndex, uint16_t attrSize, uint8_t *attrValue)
 Sends a request to read a long characteristic. More...
 
cy_en_ble_api_result_t Cy_BLE_UDSC_SetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_uds_char_index_t charIndex, cy_en_ble_uds_descr_index_t descrIndex, uint8_t attrSize, uint8_t *attrValue)
 This function is used to write the characteristic Value to the server, as identified by its charIndex. More...
 
cy_en_ble_api_result_t Cy_BLE_UDSC_GetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_uds_char_index_t charIndex, cy_en_ble_uds_descr_index_t descrIndex)
 Gets the characteristic descriptor of the specified characteristic. More...
 

Function Documentation

◆ Cy_BLE_UDSC_SetCharacteristicValue()

cy_en_ble_api_result_t Cy_BLE_UDSC_SetCharacteristicValue ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_uds_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_UDSS_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 the service characteristic.
attrSizeThe size of the characteristic value attribute.
attrValueThe pointer to the characteristic 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 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 the case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the UDS service-specific callback is registered (with Cy_BLE_UDS_RegisterAttrCallback):

◆ Cy_BLE_UDSC_GetCharacteristicValue()

cy_en_ble_api_result_t Cy_BLE_UDSC_GetCharacteristicValue ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_uds_char_index_t  charIndex 
)

This function is used to read the characteristic Value from a server, as identified by its charIndex.

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

The Read Response only contains the characteristic Value that is less than or equal to (MTU - 1) octets in length. If the characteristic Value is greater than (MTU - 1) octets in length, the Read Long Characteristic Value procedure may be used if the rest of the characteristic Value is required.

Parameters
connHandleThe connection handle.
charIndexThe index of the service characteristic.
Returns
A return value of type cy_en_ble_api_result_t.
Error Codes Description
CY_BLE_SUCCESS The Read 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 UDS service-specific callback is registered (with Cy_BLE_UDS_RegisterAttrCallback): Otherwise (if the UDS service-specific callback is not registered):

◆ Cy_BLE_UDSC_GetLongCharacteristicValue()

cy_en_ble_api_result_t Cy_BLE_UDSC_GetLongCharacteristicValue ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_uds_char_index_t  charIndex,
uint16_t  attrSize,
uint8_t *  attrValue 
)

Sends a request to read a long characteristic.

Parameters
connHandleThe connection handle.
charIndexThe index of the service characteristic.
attrSizeThe size of the characteristic value attribute.
attrValueThe pointer to the buffer where the read long characteristic descriptor value should be stored.
Returns
A return value of type cy_en_ble_api_result_t.
Error Codes Description
CY_BLE_SUCCESS The Read 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 the case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the UDS service-specific callback is registered (with Cy_BLE_UDS_RegisterAttrCallback): Otherwise (if the UDS service-specific callback is not registered):

◆ Cy_BLE_UDSC_SetCharacteristicDescriptor()

cy_en_ble_api_result_t Cy_BLE_UDSC_SetCharacteristicDescriptor ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_uds_char_index_t  charIndex,
cy_en_ble_uds_descr_index_t  descrIndex,
uint8_t  attrSize,
uint8_t *  attrValue 
)

This function is used to write the characteristic Value to the server, as identified by its charIndex.

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 the service characteristic.
descrIndexThe index of the service characteristic descriptor.
attrSizeThe size of the characteristic descriptor 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_GATT_DB_INVALID_ATTR_HANDLE The peer device doesn't have the particular characteristic.
CY_BLE_ERROR_INVALID_OPERATION This operation is not permitted on the specified attribute.
Events
In the case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the UDS service-specific callback is registered (with Cy_BLE_UDS_RegisterAttrCallback): Otherwise (if the UDS service-specific callback is not registered):

◆ Cy_BLE_UDSC_GetCharacteristicDescriptor()

cy_en_ble_api_result_t Cy_BLE_UDSC_GetCharacteristicDescriptor ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_uds_char_index_t  charIndex,
cy_en_ble_uds_descr_index_t  descrIndex 
)

Gets the characteristic descriptor of the specified characteristic.

Parameters
connHandleThe connection handle
connHandleThe connection handle.
charIndexThe index of the service characteristic.
descrIndexThe index of the service characteristic descriptor.
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_GATT_DB_INVALID_ATTR_HANDLE The peer device doesn't have the particular descriptor.
CY_BLE_ERROR_INVALID_OPERATION This operation is not permitted on the specified attribute.
Events
In the case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the UDS service-specific callback is registered (with Cy_BLE_UDS_RegisterAttrCallback): Otherwise (if the UDS service-specific callback is not registered):