API unique to ANCS designs configured as a GATT Client role.
A letter 'c' is appended to the API name: Cy_BLE_ANCSC_
◆ Cy_BLE_ANCSC_SetCharacteristicValue()
This function is used to write the characteristic (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's side, a CY_BLE_EVT_ANCSS_WRITE_CHAR event is generated. On successful request execution on the server's side, a 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_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 an ANCS service-specific callback is registered with Cy_BLE_ANCS_RegisterAttrCallback():
Otherwise (if an ANCS service-specific callback is not registered):
◆ Cy_BLE_ANCSC_SetCharacteristicDescriptor()
This function is used to write the characteristic value to the server identified by its charIndex.
Internally, a 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 the service characteristic. |
descrIndex | The index of the service characteristic descriptor. |
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. |
- 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
- If execution is successful (return value = CY_BLE_SUCCESS), these events can appear:
If an ANCS service-specific callback is registered with Cy_BLE_ANCS_RegisterAttrCallback():
Otherwise (if an ANCS service-specific callback is not registered):
◆ Cy_BLE_ANCSC_GetCharacteristicDescriptor()
Gets the characteristic descriptor of the specified characteristic.
- Parameters
-
connHandle | The connection handle. |
charIndex | The index of the service characteristic. |
descrIndex | The index of the 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_GATT_DB_INVALID_ATTR_HANDLE | The peer device doesn't have the particular descriptor. |
CY_BLE_ERROR_INVALID_STATE | The state is not valid. |
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED | Memory allocation failed. |
- Events
- If execution is successful (return value = CY_BLE_SUCCESS), these following events can appear:
If an ANCS service-specific callback is registered with Cy_BLE_ANCS_RegisterAttrCallback():
Otherwise (if an ANCS service-specific callback is not registered):