These are API common to both GATT Client role and GATT Server role.
You may use them in either roles.
No letter is appended to the API name: Cy_BLE_HIDS_
◆ Cy_BLE_HIDSS_Init()
This function initializes server of the HID service.
- Parameters
-
config | Configuration structure for the HID. |
- Returns
- cy_en_ble_api_result_t : Return value indicates whether the function succeeded or failed. The following are possible error codes.
Error Codes | Description |
CY_BLE_SUCCESS | The function completed successfully. |
CY_BLE_ERROR_INVALID_PARAMETER | On specifying NULL as input parameter. |
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED | Buffer overflow in the registration callback. |
◆ Cy_BLE_HIDSC_Init()
This function initializes client of the HID service.
- Parameters
-
config | Configuration structure for the HID. |
- Returns
- cy_en_ble_api_result_t : Return value indicates whether the function succeeded or failed. The following are possible error codes.
Error Codes | Description |
CY_BLE_SUCCESS | The function completed successfully. |
CY_BLE_ERROR_INVALID_PARAMETER | On specifying NULL as input parameter. |
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED | Buffer overflow in the registration callback. |
◆ Cy_BLE_HIDS_RegisterAttrCallback()
Registers a callback function for HID service-specific attribute operations.
Service-specific Write Requests from peer device will not be handled with unregistered callback function.
- Parameters
-
callbackFunc | An application layer event callback function to receive events from the PSoC 6 BLE Middleware. The definition of cy_ble_callback_t for HID service is:
typedef void (* cy_ble_callback_t) (uint32_t eventCode, void *eventParam), where:
- eventCode indicates the event that triggered this callback. (e.g. CY_BLE_EVT_HIDSS_NOTIFICATION_ENABLED).
- eventParam: Contains the parameters corresponding to the current event; (e.g. pointer to cy_stc_ble_hids_char_value_t structure that contains details of the characteristic for which the notification enabled event was triggered).
|
- Side Effects
- The *eventParams in the callback function should not be used by the application once the callback function execution is finished. Otherwise this data may become corrupted.