API unique to HID designs configured as a GATT Client role.
A letter 'c' is appended to the API name: Cy_BLE_HIDSC_
|
cy_en_ble_api_result_t | Cy_BLE_HIDSC_SetCharacteristicValue (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_hidsc_char_write_t subProcedure, uint8_t serviceIndex, cy_en_ble_hids_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue) |
| Sends a request to set characteristic value of the specified HID service, which is identified by serviceIndex and reportIndex, on the server device. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_HIDSC_GetCharacteristicValue (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_hidsc_char_read_t subProcedure, uint8_t serviceIndex, cy_en_ble_hids_char_index_t charIndex) |
| This function is used to read the characteristic value from a server which is identified by charIndex. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_HIDSC_SetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, uint8_t serviceIndex, cy_en_ble_hids_char_index_t charIndex, cy_en_ble_hids_descr_t descrIndex, uint8_t attrSize, uint8_t *attrValue) |
| Sends a request to the peer device to set the characteristic descriptor of the specified characteristic of HID service. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_HIDSC_GetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, uint8_t serviceIndex, cy_en_ble_hids_char_index_t charIndex, cy_en_ble_hids_descr_t descrIndex) |
| Gets a characteristic descriptor of the specified characteristic of the HID service from the server device. More...
|
|
◆ Cy_BLE_HIDSC_SetCharacteristicValue()
Sends a request to set characteristic value of the specified HID service, which is identified by serviceIndex and reportIndex, on the server device.
This function call can result in generation of the following events based on the response from the server device:
- Parameters
-
connHandle | The connection handle. |
subProcedure | Characteristic value write sub-procedure.
|
serviceIndex | The index of the service instance. e.g. If two HID services are supported in your design, then first service will be identified by serviceIndex of 0 and the second by serviceIndex of 1. |
charIndex | The index of the service characteristic of type cy_en_ble_hids_char_index_t. |
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_GATT_DB_INVALID_ATTR_HANDLE | The peer device doesn't have the particular characteristic. |
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 HIDS service-specific callback is registered with Cy_BLE_HIDS_RegisterAttrCallback():
Otherwise, if the HIDS service-specific callback is not registered:
◆ Cy_BLE_HIDSC_GetCharacteristicValue()
This function is used to read the characteristic value from a server which is identified by charIndex.
The Read Response returns the characteristic value in the Attribute Value parameter. The Read Response only contains the characteristic value that is less than or equal to (MTU - 1) octets in length. If the characteristic value is greater than (MTU - 1) octets in length, the Read Long Characteristic Value procedure may be used if the rest of the characteristic Value is required.
- Parameters
-
connHandle | The connection handle. |
subProcedure | The characteristic value read sub-procedure.
|
serviceIndex | The index of the service instance. e.g. If two HID services are supported in your design, then first service will be identified by serviceIndex of 0 and the second by serviceIndex of 1. |
charIndex | The index of the service characteristic of type cy_en_ble_hids_char_index_t. |
- 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 | The peer device doesn't have the particular characteristic |
- Events
- In case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the HID service-specific callback is registered with Cy_BLE_HIDS_RegisterAttrCallback():
Otherwise (if an HID service-specific callback is not registered):
◆ Cy_BLE_HIDSC_SetCharacteristicDescriptor()
Sends a request to the peer device to set the characteristic descriptor of the specified characteristic of HID 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 BLE peer device connection handle. |
serviceIndex | The index of the service instance. e.g. If two HID services are supported in your design, then first service will be identified by serviceIndex of 0 and the second by serviceIndex of 1. |
charIndex | The index of the service characteristic of type cy_en_ble_hids_char_index_t. |
descrIndex | The index of the service characteristic descriptor of type cy_en_ble_hids_descr_t. |
attrSize | The size of the characteristic 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
- In case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the HIDS service-specific callback is registered with Cy_BLE_HIDS_RegisterAttrCallback():
Otherwise (if an HID service-specific callback is not registered):
◆ Cy_BLE_HIDSC_GetCharacteristicDescriptor()
Gets a characteristic descriptor of the specified characteristic of the HID service from the server device.
This function call can result in generation of the following events based on the response from the server device.
- Parameters
-
connHandle | The connection handle. |
serviceIndex | The index of the service instance. e.g. If two HID services are supported in your design, then first service will be identified by serviceIndex of 0 and the second by serviceIndex of 1. |
charIndex | The index of the service characteristic of type cy_en_ble_hids_char_index_t. |
descrIndex | The index of the service characteristic descriptor of type cy_en_ble_hids_descr_t. |
- 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. |
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE | The peer device doesn't have the particular descriptor |
- Events
- In case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the HID service-specific callback is registered with Cy_BLE_HIDS_RegisterAttrCallback():
Otherwise (if an HID service-specific callback is not registered):