API unique to HRS designs configured as a GATT Client role.
A letter 'c' is appended to the API name: Cy_BLE_HRSC_
Functions | |
cy_en_ble_api_result_t | Cy_BLE_HRSC_SetCharacteristicValue (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_hrs_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue) |
This function is used to write the characteristic value attribute (identified by charIndex) to the server. More... | |
cy_en_ble_api_result_t | Cy_BLE_HRSC_GetCharacteristicValue (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_hrs_char_index_t charIndex) |
Sends a request to the peer device to get a characteristic value, as identified by its charIndex. More... | |
cy_en_ble_api_result_t | Cy_BLE_HRSC_SetCharacteristicDescriptor (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) |
This function is used to write the characteristic Value to the server, which is identified by charIndex. More... | |
cy_en_ble_api_result_t | Cy_BLE_HRSC_GetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_hrs_char_index_t charIndex, cy_en_ble_hrs_descr_index_t descrIndex) |
Gets a characteristic descriptor of a specified characteristic of the service. More... | |
cy_en_ble_api_result_t Cy_BLE_HRSC_SetCharacteristicValue | ( | cy_stc_ble_conn_handle_t | connHandle, |
cy_en_ble_hrs_char_index_t | charIndex, | ||
uint8_t | attrSize, | ||
uint8_t * | attrValue | ||
) |
This function is used to write the characteristic value attribute (identified by charIndex) to the server.
The Write Response just confirms the operation success.
This function call can result in generation of the following events based on the response from the server device:
connHandle | The connection handle. |
charIndex | The index of the service characteristic of type cy_en_ble_hrs_char_index_t. |
attrSize | The size of the characteristic value attribute. |
attrValue | The pointer to the characteristic value data that should be sent to the server device. |
Error Codes | Description |
---|---|
CY_BLE_SUCCESS | The request was sent 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_GATT_DB_INVALID_ATTR_HANDLE | The peer device doesn't have the particular characteristic. |
CY_BLE_ERROR_INVALID_STATE | Connection with the server is not established. |
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED | Memory allocation failed. |
cy_en_ble_api_result_t Cy_BLE_HRSC_GetCharacteristicValue | ( | cy_stc_ble_conn_handle_t | connHandle, |
cy_en_ble_hrs_char_index_t | charIndex | ||
) |
Sends a request to the peer device to get a characteristic value, as identified by its charIndex.
The Read Response returns the characteristic Value in the Attribute Value parameter.
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.
connHandle | The connection handle. |
charIndex | The index of the service characteristic of type cy_en_ble_hrs_char_index_t. |
Error Codes | Description |
---|---|
CY_BLE_SUCCESS | The request was sent 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 server is not established. |
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED | Memory allocation failed. |
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE | The peer device doesn't have the particular characteristic |
cy_en_ble_api_result_t Cy_BLE_HRSC_SetCharacteristicDescriptor | ( | 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 | ||
) |
This function is used to write the characteristic Value to the server, which is identified by charIndex.
This function call can result in generation of the following events based on the response from the server device:
One of the following events are received by the peer device, on invoking this function:
connHandle | The connection handle. |
charIndex | The index of the service characteristic of type cy_en_ble_hrs_char_index_t. |
descrIndex | The index of the service characteristic descriptor of type cy_en_ble_hrs_descr_index_t.* |
attrSize | The size of the characteristic descriptor value attribute. |
attrValue | The pointer to the characteristic descriptor value data that should be sent to the server device. |
Error Codes | Description |
---|---|
CY_BLE_SUCCESS | The request was sent 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_GATT_DB_INVALID_ATTR_HANDLE | The peer device doesn't have the particular characteristic. |
CY_BLE_ERROR_INVALID_STATE | The state is not valid. |
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED | Memory allocation failed. |
cy_en_ble_api_result_t Cy_BLE_HRSC_GetCharacteristicDescriptor | ( | cy_stc_ble_conn_handle_t | connHandle, |
cy_en_ble_hrs_char_index_t | charIndex, | ||
cy_en_ble_hrs_descr_index_t | descrIndex | ||
) |
Gets a characteristic descriptor of a specified characteristic of the service.
This function call can result in generation of the following events based on the response from the server device:
connHandle | The connection handle. |
charIndex | The index of the service characteristic of type cy_en_ble_hrs_char_index_t. |
descrIndex | The index of the service characteristic descriptor of type cy_en_ble_hrs_descr_index_t.* |
Error Codes | Description |
---|---|
CY_BLE_SUCCESS | The request was sent successfully. |
CY_BLE_ERROR_INVALID_PARAMETER | Validation of the input parameter failed. |
CY_BLE_ERROR_INVALID_OPERATION | This operation is not permitted on the specified attribute. |
CY_BLE_ERROR_INVALID_STATE | The state is not valid. |
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED | Memory allocation failed. |
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE | The peer device doesn't have |
the particular descriptor