Cypress PSoC 6 Bluetooth Low Energy Middleware Library 3.60

General Description

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

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

Functions

cy_en_ble_api_result_t Cy_BLE_BCSS_SetCharacteristicValue (cy_en_ble_bcs_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue)
 Sets a value for one of the three characteristic values of the Body Composition service. More...
 
cy_en_ble_api_result_t Cy_BLE_BCSS_GetCharacteristicValue (cy_en_ble_bcs_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue)
 Reads a characteristic value of the Body Composition service identified by charIndex from the GATT database. More...
 
cy_en_ble_api_result_t Cy_BLE_BCSS_SetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_bcs_char_index_t charIndex, cy_en_ble_bcs_descr_index_t descrIndex, uint8_t attrSize, uint8_t *attrValue)
 Sets the characteristic descriptor of the specified characteristic. More...
 
cy_en_ble_api_result_t Cy_BLE_BCSS_GetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_bcs_char_index_t charIndex, cy_en_ble_bcs_descr_index_t descrIndex, uint8_t attrSize, uint8_t *attrValue)
 Reads a a characteristic descriptor of the specified characteristic of the Body Composition service from the GATT database. More...
 
cy_en_ble_api_result_t Cy_BLE_BCSS_SendIndication (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_bcs_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue)
 Sends indication with a characteristic value of the Body Composition service, which is a value specified by charIndex to the client device. More...
 

Function Documentation

◆ Cy_BLE_BCSS_SetCharacteristicValue()

cy_en_ble_api_result_t Cy_BLE_BCSS_SetCharacteristicValue ( cy_en_ble_bcs_char_index_t  charIndex,
uint8_t  attrSize,
uint8_t *  attrValue 
)

Sets a value for one of the three characteristic values of the Body Composition service.

The characteristic is identified by charIndex.

Parameters
charIndexThe index of a Body Composition service characteristic of type cy_en_ble_bcs_char_index_t. The valid values are,
attrSizeThe size of the characteristic value attribute.
attrValueThe pointer to the characteristic value data that should be stored to 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_BCSS_GetCharacteristicValue()

cy_en_ble_api_result_t Cy_BLE_BCSS_GetCharacteristicValue ( cy_en_ble_bcs_char_index_t  charIndex,
uint8_t  attrSize,
uint8_t *  attrValue 
)

Reads a characteristic value of the Body Composition service identified by charIndex from the GATT database.

Parameters
charIndexThe index of a Body Composition service characteristic of type cy_en_ble_bcs_char_index_t. The valid values are,
attrSizeThe size of the Body Composition service 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_BCSS_SetCharacteristicDescriptor()

cy_en_ble_api_result_t Cy_BLE_BCSS_SetCharacteristicDescriptor ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_bcs_char_index_t  charIndex,
cy_en_ble_bcs_descr_index_t  descrIndex,
uint8_t  attrSize,
uint8_t *  attrValue 
)

Sets the characteristic descriptor of the specified characteristic.

Parameters
connHandleThe connection handle.
charIndexThe index of a Body Composition service characteristic of type cy_en_ble_bcs_char_index_t. The valid values are,
descrIndexThe index of the service characteristic descriptor of type cy_en_ble_bcs_descr_index_t. The valid value is,
attrSizeThe size of the characteristic descriptor attribute.
attrValueThe pointer to the descriptor value data to 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 characteristic descriptor value was read successfully.
CY_BLE_ERROR_INVALID_PARAMETER Validation of the input parameter failed.

◆ Cy_BLE_BCSS_GetCharacteristicDescriptor()

cy_en_ble_api_result_t Cy_BLE_BCSS_GetCharacteristicDescriptor ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_bcs_char_index_t  charIndex,
cy_en_ble_bcs_descr_index_t  descrIndex,
uint8_t  attrSize,
uint8_t *  attrValue 
)

Reads a a characteristic descriptor of the specified characteristic of the Body Composition service from the GATT database.

Parameters
connHandleThe connection handle.
charIndexThe index of a Body Composition service characteristic of type cy_en_ble_bcs_char_index_t. The valid values are,
descrIndexThe index of the service characteristic descriptor of type cy_en_ble_bcs_descr_index_t. The valid value is,
attrSizeThe size of the characteristic descriptor attribute.
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 The optional descriptor is absent.

◆ Cy_BLE_BCSS_SendIndication()

cy_en_ble_api_result_t Cy_BLE_BCSS_SendIndication ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_bcs_char_index_t  charIndex,
uint8_t  attrSize,
uint8_t *  attrValue 
)

Sends indication with a characteristic value of the Body Composition service, which is a value specified by charIndex to the client device.

On enabling indication successfully it sends out a handle value indication, which results in CY_BLE_EVT_BCSC_INDICATION or CY_BLE_EVT_GATTC_HANDLE_VALUE_IND (if service-specific callback function is not registered) event at the GATT client's end.

Parameters
connHandleThe connection handle.
charIndexThe index of a Body Composition service characteristic of type cy_en_ble_bcs_char_index_t. The valid values are,
attrSizeThe size of the characteristic descriptor attribute.
attrValueThe pointer to the characteristic value data that should be sent to the client's 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.
Events
If execution is successful (return value = CY_BLE_SUCCESS), these events can appear:
If a BCS service-specific callback is registered (with Cy_BLE_BCS_RegisterAttrCallback):

Otherwise (if a BCS service-specific callback is not registered):