Cypress PSoC 6 Bluetooth Low Energy Middleware Library 3.60

General Description

API unique to HRS designs configured as a GATT Server role.

A letter 's' is appended to the API name: Cy_BLE_HRSS_

Functions

cy_en_ble_api_result_t Cy_BLE_HRSS_SetCharacteristicValue (cy_en_ble_hrs_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue)
 Sets a characteristic value of Heart Rate service, which is a value identified by charIndex, to the local database. More...
 
cy_en_ble_api_result_t Cy_BLE_HRSS_GetCharacteristicValue (cy_en_ble_hrs_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue)
 Gets a characteristic value of Heart Rate service. More...
 
cy_en_ble_api_result_t Cy_BLE_HRSS_GetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_hrs_char_index_t charIndex, cy_en_ble_hrs_descr_index_t descrIndex, uint8_t attrSize, uint8_t *attrValue)
 Gets the local characteristic descriptor of the specified Heart Rate service characteristic. More...
 
cy_en_ble_api_result_t Cy_BLE_HRSS_SendNotification (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_hrs_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue)
 Sends notification of a specified Heart Rate service characteristic value to the client device. More...
 

Function Documentation

◆ Cy_BLE_HRSS_SetCharacteristicValue()

cy_en_ble_api_result_t Cy_BLE_HRSS_SetCharacteristicValue ( cy_en_ble_hrs_char_index_t  charIndex,
uint8_t  attrSize,
uint8_t *  attrValue 
)

Sets a characteristic value of Heart Rate service, which is a value identified by charIndex, to the local database.

Parameters
charIndexThe index of the service characteristic of type cy_en_ble_hrs_char_index_t.
attrSizeThe size of the characteristic value attribute.
attrValueThe pointer to the characteristic value data that should be stored in the GATT database.
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_INVALID_PARAMETER Validation of the input parameter failed.
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLEAn optional characteristic is absent.

◆ Cy_BLE_HRSS_GetCharacteristicValue()

cy_en_ble_api_result_t Cy_BLE_HRSS_GetCharacteristicValue ( cy_en_ble_hrs_char_index_t  charIndex,
uint8_t  attrSize,
uint8_t *  attrValue 
)

Gets a characteristic value of Heart Rate service.

The value is identified by charIndex.

Parameters
charIndexThe index of the service characteristic of type cy_en_ble_hrs_char_index_t.
attrSizeThe size of the characteristic value attribute.
attrValueThe pointer to the location where characteristic value data should be stored.
Returns
A return value of type cy_en_ble_api_result_t.
Error Codes Description
CY_BLE_SUCCESS The characteristic value was read successfully.
CY_BLE_ERROR_INVALID_PARAMETER Validation of the input parameter failed.
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE Optional characteristic is absent.

◆ Cy_BLE_HRSS_GetCharacteristicDescriptor()

cy_en_ble_api_result_t Cy_BLE_HRSS_GetCharacteristicDescriptor ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_hrs_char_index_t  charIndex,
cy_en_ble_hrs_descr_index_t  descrIndex,
uint8_t  attrSize,
uint8_t *  attrValue 
)

Gets the local characteristic descriptor of the specified Heart Rate service characteristic.

Parameters
connHandleThe connection handle
charIndexThe index of the service characteristic of type cy_en_ble_hrs_char_index_t.
descrIndexThe index of the service characteristic descriptor of type cy_en_ble_hrs_descr_index_t.
attrSizeThe size of the descriptor value attribute. The Heart Rate Measurement characteristic client configuration descriptor has 2 bytes length.
attrValueThe pointer to the location where characteristic descriptor value data should be stored.
Returns
A return value of type cy_en_ble_api_result_t.
Error Codes Description
CY_BLE_SUCCESS The characteristic descriptor value was read successfully.
CY_BLE_ERROR_INVALID_PARAMETER Validation of the input parameter failed.
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE Optional descriptor is absent.

◆ Cy_BLE_HRSS_SendNotification()

cy_en_ble_api_result_t Cy_BLE_HRSS_SendNotification ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_hrs_char_index_t  charIndex,
uint8_t  attrSize,
uint8_t *  attrValue 
)

Sends notification of a specified Heart Rate service characteristic value to the client device.

No response is expected.

On enabling notification successfully for a service characteristic it sends out a 'Handle Value Notification' which results in CY_BLE_EVT_HRSC_NOTIFICATION event at the GATT Client's end.

Parameters
connHandleThe connection handle.
charIndexThe index of the service characteristic of type cy_en_ble_hrs_char_index_t.
attrSizeThe size of the characteristic value attribute.
attrValueThe pointer to the characteristic value data that should be sent to the client device.
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_INVALID_PARAMETER Validation of the input parameter failed.
CY_BLE_ERROR_INVALID_OPERATION Operation is invalid for this characteristic.
CY_BLE_ERROR_INVALID_STATE Connection with the client is not established.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED Memory allocation failed.
CY_BLE_ERROR_NTF_DISABLED Notification is not enabled by the client.