BLE HID (HID over GATT) submodule.
More...
BLE HID (HID over GATT) submodule.
This submodule implements the HID over GATT Service. It provides an API for setting up descriptors and reports. Because it does not include a HID parser, reports are set up manually (see BLE_HID_REPORT_MAP_CONF and BLE_HID_REPORT_CONF). The descriptors and associated report configurations are stored in flash. The HoG Service is created once m_coms_ble_hid_init is called. At this point, the SoftDevice must be enabled.
Like other BLE Services, this module must be notified when relevant BLE events occur. This module will generate HID-related events (boot mode enabled, output reports written, etc.)
uint32_t m_coms_ble_hid_feature_report_set |
( |
uint8_t |
p_interface_idx, |
|
|
uint8_t |
p_report_idx, |
|
|
uint8_t * |
p_data, |
|
|
uint16_t |
p_len |
|
) |
| |
Function for setting the content of a feature report.
- Parameters
-
[in] | p_interface_idx | Which interface to use. |
[in] | p_report_idx | Which report ID to use. |
[in] | p_data | Report data. |
[in] | p_len | Length of data. |
- Returns
- Return values
-
NRF_SUCCESS | |
NRF_ERROR_INVALID_PARAM | |
uint32_t m_coms_ble_hid_init |
( |
const m_coms_ble_hid_init_t * |
p_params, |
|
|
uint16_t * |
p_last_input_report_cccd_handle |
|
) |
| |
Function for initializing the HID submodule.
- Parameters
-
[in] | p_params | HID Parameters. |
[out] | p_last_input_report_cccd_handle | Pointer to the last CCCD handle added by the HID service. |
- Note
- The obtained CCCD handle could be later used to detect HID services activation.
- Returns
- NRF_SUCCESS on success, otherwise error code.
uint32_t m_coms_ble_hid_input_report_send |
( |
uint8_t |
p_interface_idx, |
|
|
uint8_t |
p_report_idx, |
|
|
uint8_t * |
p_data, |
|
|
uint8_t |
p_len |
|
) |
| |
Function for sending an input report.
- Parameters
-
[in] | p_interface_idx | Which interface to use. |
[in] | p_report_idx | Which report ID to use. |
[in] | p_data | The data to send. |
[in] | p_len | Length of data. |
- Returns
- Return values
-
NRF_SUCCESS | |
NRF_ERROR_INVALID_PARAM | |
Function for sending a HID keyboard boot report.
- Note
- One of the HID services must be configured to have a keyboard boot report.
- Parameters
-
[in] | p_pkt | Boot packet type. |
- Returns
- Return values
-
NRF_SUCCESS | |
NRF_ERROR_DATA_SIZE | |
NRF_ERROR_INVALID_STATE | |
Function for sending a HID mouse boot report.
- Note
- One of the HID services must be configured to have a mouse boot report.
- Parameters
-
[in] | p_pkt | Boot packet type. |
- Returns
- Return values
-
NRF_SUCCESS | |
NRF_ERROR_DATA_SIZE | |
NRF_ERROR_INVALID_STATE | |