API unique to RSCS designs configured as a GATT Server role.
A letter 's' is appended to the API name: Cy_BLE_RSCSS_
|
cy_en_ble_api_result_t | Cy_BLE_RSCSS_SetCharacteristicValue (cy_en_ble_rscs_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue) |
| Sets the characteristic value of the Running Speed and Cadence service in the local GATT database. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_RSCSS_GetCharacteristicValue (cy_en_ble_rscs_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue) |
| Gets the characteristic value of the Running Speed and Cadence service from the GATT database. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_RSCSS_GetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_rscs_char_index_t charIndex, cy_en_ble_rscs_descr_index_t descrIndex, uint8_t attrSize, uint8_t *attrValue) |
| Gets the characteristic descriptor of a specified characteristic of the Running Speed and Cadence service from the GATT database. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_RSCSS_SendNotification (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_rscs_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue) |
| Sends a notification with the characteristic value to the client device. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_RSCSS_SendIndication (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_rscs_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue) |
| Sends an indication with a characteristic value to the client device. More...
|
|
◆ Cy_BLE_RSCSS_SetCharacteristicValue()
Sets the characteristic value of the Running Speed and Cadence service in the local GATT database.
The characteristic is identified by charIndex.
- Parameters
-
charIndex | The index of a service characteristic. Valid values are,
- CY_BLE_RSCS_RSC_FEATURE
- CY_BLE_RSCS_SENSOR_LOCATION.
|
attrSize | The size of the characteristic value attribute. |
attrValue | The 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_HANDLE | Optional characteristic is absent. |
◆ Cy_BLE_RSCSS_GetCharacteristicValue()
Gets the characteristic value of the Running Speed and Cadence service from the GATT database.
The characteristic is identified by charIndex.
- Parameters
-
charIndex | The index of a service characteristic. |
attrSize | The size of the characteristic value attribute. |
attrValue | The 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 request was handled successfully. |
CY_BLE_ERROR_INVALID_PARAMETER | Validation of the input parameter failed. |
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE | Peer device doesn't have a particular characteristic. |
◆ Cy_BLE_RSCSS_GetCharacteristicDescriptor()
Gets the characteristic descriptor of a specified characteristic of the Running Speed and Cadence service from the GATT database.
- Parameters
-
connHandle | The connection handle |
charIndex | The index of a service characteristic. Valid values are,
- CY_BLE_RSCS_RSC_MEASUREMENT
- CY_BLE_RSCS_SC_CONTROL_POINT
|
descrIndex | The index of a service characteristic descriptor. Valid value is,
|
attrSize | The size of the characteristic descriptor attribute. |
attrValue | The 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 request was handled successfully. |
CY_BLE_ERROR_INVALID_PARAMETER | Validation of the input parameter failed. |
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE | Peer device doesn't have a particular descriptor. |
◆ Cy_BLE_RSCSS_SendNotification()
Sends a notification with the characteristic value to the client device.
This is specified by charIndex of the Running Speed and Cadence service.
On enabling notification successfully for a service characteristic it sends out a 'Handle Value Notification' which results in CY_BLE_EVT_RSCSC_NOTIFICATION event at the GATT Client's end.
- Parameters
-
connHandle | The connection handle. |
charIndex | The index of a service characteristic. Valid value is,
- CY_BLE_RSCS_RSC_MEASUREMENT
|
attrSize | The size of the characteristic value attribute. |
attrValue | The 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 input parameter is 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_NTF_DISABLED | Notification is not enabled by the client. |
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED | Memory allocation failed. |
◆ Cy_BLE_RSCSS_SendIndication()
Sends an indication with a characteristic value to the client device.
This is specified by charIndex of the Running Speed and Cadence service.
On enabling indication successfully it sends out a 'Handle Value Indication' which results in CY_BLE_EVT_RSCSC_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
-
connHandle | The connection handle. |
charIndex | The index of a service characteristic. |
attrSize | The size of the characteristic value attribute. |
attrValue | The 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 input parameter is 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_IND_DISABLED | Indication is not enabled by the client. |
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED | Memory allocation failed. |
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE | Peer device doesn't have a particular characteristic. |
- Events
- In case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the RSCS service-specific callback is registered (with Cy_BLE_RSCS_RegisterAttrCallback):
Otherwise (if the RSCS service-specific callback is not registered):