API unique to CSCS designs configured as a GATT Client role.
A letter 'c' is appended to the API name: Cy_BLE_CSCSC_
|
cy_en_ble_api_result_t | Cy_BLE_CSCSC_SetCharacteristicValue (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_cscs_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_CSCSC_GetCharacteristicValue (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_cscs_char_index_t charIndex) |
| Sends a request to peer device to get characteristic value of the Cycling Speed and Cadence service, which is identified by charIndex. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_CSCSC_SetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_cscs_char_index_t charIndex, cy_en_ble_cscs_descr_index_t descrIndex, uint8_t attrSize, uint8_t *attrValue) |
| Sends a request to peer device to get characteristic descriptor of specified characteristic of the Cycling Speed and Cadence service. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_CSCSC_GetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_cscs_char_index_t charIndex, cy_en_ble_cscs_descr_index_t descrIndex) |
| Sends a request to peer device to get characteristic descriptor of specified characteristic of the Cycling Speed and Cadence service. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_CSCSC_StoreProfileData (void) |
| Stores the structure with discovered attributes of Cycling Speed and Cadence Server device to the flash. More...
|
|
◆ Cy_BLE_CSCSC_SetCharacteristicValue()
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_CSCSS_WRITE_CHAR event is generated. On successful request execution on the server side, the Write Response is sent to the client.
- Parameters
-
connHandle | The connection handle. |
charIndex | The index of a service characteristic. |
attrSize | Size of the characteristic value attribute. |
attrValue | 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 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. |
- Events
- In case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the CSCS service-specific callback is registered with Cy_BLE_CSCS_RegisterAttrCallback():
Otherwise (if the CSCS service-specific callback is not registered):
◆ Cy_BLE_CSCSC_GetCharacteristicValue()
Sends a request to peer device to get characteristic value of the Cycling Speed and Cadence service, which is identified by charIndex.
- Parameters
-
connHandle | The connection handle. |
charIndex | The index of a service characteristic. |
- 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 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 | 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 CSCS service-specific callback is registered (with Cy_BLE_CSCS_RegisterAttrCallback):
Otherwise, if the CSCS service-specific callback is not registered:
◆ Cy_BLE_CSCSC_SetCharacteristicDescriptor()
Sends a request to peer device to get characteristic descriptor of specified characteristic of the Cycling Speed and Cadence service.
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
-
connHandle | The connection handle. |
charIndex | The index of a CSCS characteristic. |
descrIndex | The index of a CSCS characteristic descriptor. |
attrSize | The size of the characteristic descriptor attribute. |
attrValue | The 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 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. |
- Events
- In case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the CSCS service-specific callback is registered with Cy_BLE_CSCS_RegisterAttrCallback():
Otherwise (if the CSCS service-specific callback is not registered):
◆ Cy_BLE_CSCSC_GetCharacteristicDescriptor()
Sends a request to peer device to get characteristic descriptor of specified characteristic of the Cycling Speed and Cadence service.
- Parameters
-
connHandle | The connection handle. |
charIndex | The index of a service Characteristic. |
descrIndex | The index of a 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 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. |
- Events
- In case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the CSCS service-specific callback is registered with Cy_BLE_CSCS_RegisterAttrCallback():
Otherwise (if the CSCS service-specific callback is not registered):
◆ Cy_BLE_CSCSC_StoreProfileData()
Stores the structure with discovered attributes of Cycling Speed and Cadence Server device to the flash.
- Returns
- A return value of type cy_en_ble_api_result_t.
Error Codes | Description |
CY_BLE_SUCCESS | On successful operation. |
CY_BLE_ERROR_INVALID_PARAMETER | On specifying NULL as cy_ble_cscscConfigPtr. |
CY_BLE_ERROR_FLASH_WRITE | An error in the flash Write. |