API unique to BAS designs configured as a GATT Client role.
A letter 'c' is appended to the API name: Cy_BLE_BASC_
Functions | |
cy_en_ble_api_result_t | Cy_BLE_BASC_GetCharacteristicValue (cy_stc_ble_conn_handle_t connHandle, uint8_t serviceIndex, cy_en_ble_bas_char_index_t charIndex) |
This function is used to read the characteristic value from the server identified by charIndex. More... | |
cy_en_ble_api_result_t | Cy_BLE_BASC_SetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, uint8_t serviceIndex, cy_en_ble_bas_char_index_t charIndex, cy_en_ble_bas_descr_index_t descrIndex, uint8_t attrSize, uint8_t *attrValue) |
Sends a request to set a characteristic descriptor of the specified Battery service characteristic on the server device. More... | |
cy_en_ble_api_result_t | Cy_BLE_BASC_GetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, uint8_t serviceIndex, cy_en_ble_bas_char_index_t charIndex, cy_en_ble_bas_descr_index_t descrIndex) |
Sends a request to get a characteristic descriptor of the specified Battery service characteristic from the server device. More... | |
cy_en_ble_api_result_t Cy_BLE_BASC_GetCharacteristicValue | ( | cy_stc_ble_conn_handle_t | connHandle, |
uint8_t | serviceIndex, | ||
cy_en_ble_bas_char_index_t | charIndex | ||
) |
This function is used to read the characteristic value from the server identified by charIndex.
This function call can result in generation of the following events based on a response from the server device:
connHandle | The BLE peer device connection handle. |
serviceIndex | The index of the service instance; e.g. if two Battery services are supported in your design, then the first service will be identified by serviceIndex of 0 and the second service by serviceIndex of 1. |
charIndex | The index of a service characteristic of type cy_en_ble_bas_char_index_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. |
Otherwise (if a BAS service-specific callback is not registered):
cy_en_ble_api_result_t Cy_BLE_BASC_SetCharacteristicDescriptor | ( | cy_stc_ble_conn_handle_t | connHandle, |
uint8_t | serviceIndex, | ||
cy_en_ble_bas_char_index_t | charIndex, | ||
cy_en_ble_bas_descr_index_t | descrIndex, | ||
uint8_t | attrSize, | ||
uint8_t * | attrValue | ||
) |
Sends a request to set a characteristic descriptor of the specified Battery service characteristic on the server device.
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:
connHandle | The BLE peer device connection handle. |
serviceIndex | The index of the service instance; e.g. if two Battery services are supported in your design, then the first service will be identified by serviceIndex of 0 and the second service by serviceIndex of 1. |
charIndex | The index of a service characteristic of type cy_en_ble_bas_char_index_t. |
descrIndex | The index of a service characteristic descriptor of type cy_en_ble_bas_descr_index_t. |
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. |
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. |
Otherwise (if a BAS service-specific callback is not registered):
cy_en_ble_api_result_t Cy_BLE_BASC_GetCharacteristicDescriptor | ( | cy_stc_ble_conn_handle_t | connHandle, |
uint8_t | serviceIndex, | ||
cy_en_ble_bas_char_index_t | charIndex, | ||
cy_en_ble_bas_descr_index_t | descrIndex | ||
) |
Sends a request to get a characteristic descriptor of the specified Battery service characteristic from the server device.
This function call can result in generation of the following events based on a response from the server device:
connHandle | The BLE peer device connection handle. |
serviceIndex | The index of the service instance; e.g. if two Battery services are supported in your design, then the first service will be identified by serviceIndex of 0 and the second service by serviceIndex of 1. |
charIndex | The index of a service characteristic of type cy_en_ble_bas_char_index_t. |
descrIndex | The index of a service characteristic descriptor of type cy_en_ble_bas_descr_index_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. |