API unique to LLS designs configured as a GATT Client role.
A letter 'c' is appended to the API name: Cy_BLE_LLSC_
◆ Cy_BLE_LLSC_SetCharacteristicValue()
Sets the Alert Level characteristic value of the Link Loss service, which is identified by charIndex.
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_LLSS_WRITE_CHAR_REQ 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 Alert Level service characteristic. |
attrSize | The size of the Alert Level characteristic value attribute. |
attrValue | The pointer to the Alert Level 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
- If execution is successful (return value = CY_BLE_SUCCESS), these events can appear:
If a LLS service-specific callback is registered with Cy_BLE_LLS_RegisterAttrCallback():
Otherwise (if a LLS service-specific callback is not registered):
◆ Cy_BLE_LLSC_GetCharacteristicValue()
Sends a request to get characteristic value of the Link Loss service, which is identified by charIndex.
This function call can result in generation of the following events based on the response from the server device:
- Parameters
-
connHandle | The connection handle. |
charIndex | The index of the Link Loss 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. |
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE | The peer device doesn't have the particular characteristic. |
- Events
- If execution is successful (return value = CY_BLE_SUCCESS) these events can appear:
If the LLS service-specific callback is registered (with Cy_BLE_LLS_RegisterAttrCallback):
Otherwise (if a LLS service-specific callback is not registered):