API unique to RTUS designs configured as a GATT Client role.
A letter 'c' is appended to the API name: Cy_BLE_RTUSC_
◆ Cy_BLE_RTUSC_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_RTUSS_WRITE_CHAR_CMD 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 the service characteristic. |
attrSize | The size of the characteristic value attribute. |
attrValue | The 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_INVALID_STATE | Connection with the server is not established. |
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED | Memory allocation failed. |
◆ Cy_BLE_RTUSC_GetCharacteristicValue()
Sends a request to a peer device to set characteristic value of the Reference Time Update 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 Read 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. |
- Events
- In case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the RTUS service-specific callback is registered (with Cy_BLE_RTUS_RegisterAttrCallback):
Otherwise (if the RTUS service-specific callback is not registered):