Smart Remote 3 nRF52 v1.2
Data Structures | Macros | Typedefs | Functions
BLE HID over GATT submodule

BLE HID (HID over GATT) submodule. More...

Data Structures

struct  ble_hid_db_s
 Database layout. More...
 
struct  ble_hid_ext_map_record_t
 Database record containing external service mapping information. More...
 
struct  ble_hid_report_map_record_t
 Database record containing HID report map info. More...
 
struct  ble_hid_report_record_t
 Database record containing HID report information. More...
 
struct  m_coms_ble_hid_evt_t
 Event type generated by this module. More...
 

Macros

#define BLE_HID_EXT_MAP_CONF(_interface_idx,_external_char_uuid)
 Initializer of ble_hid_ext_map_record_t.
 
#define BLE_HID_REPORT_CONF(_interface_idx,_report_type,_read_resp,_report_id,_report_len)
 Initializer of ble_hid_report_record_t.
 
#define BLE_HID_REPORT_MAP_CONF(_interface,_report_map,_report_map_len,_boot_type)
 Initializer of ble_hid_report_map_record_t.
 

Typedefs

typedef struct ble_hid_db_s ble_hid_db_t
 Database layout.
 

Functions

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. More...
 
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. More...
 
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. More...
 
uint32_t m_coms_ble_hid_keyboard_boot_report_send (const m_coms_hid_boot_pkt_t *p_pkt)
 Function for sending a HID keyboard boot report. More...
 
uint32_t m_coms_ble_hid_mouse_boot_report_send (const m_coms_hid_boot_pkt_t *p_pkt)
 Function for sending a HID mouse boot report. More...
 

Detailed Description

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.)

Function Documentation

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_idxWhich interface to use.
[in]p_report_idxWhich report ID to use.
[in]p_dataReport data.
[in]p_lenLength 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_paramsHID Parameters.
[out]p_last_input_report_cccd_handlePointer 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_idxWhich interface to use.
[in]p_report_idxWhich report ID to use.
[in]p_dataThe data to send.
[in]p_lenLength of data.
Returns
Return values
NRF_SUCCESS
NRF_ERROR_INVALID_PARAM
uint32_t m_coms_ble_hid_keyboard_boot_report_send ( const m_coms_hid_boot_pkt_t p_pkt)

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_pktBoot packet type.
Returns
Return values
NRF_SUCCESS
NRF_ERROR_DATA_SIZE
NRF_ERROR_INVALID_STATE
uint32_t m_coms_ble_hid_mouse_boot_report_send ( const m_coms_hid_boot_pkt_t p_pkt)

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_pktBoot packet type.
Returns
Return values
NRF_SUCCESS
NRF_ERROR_DATA_SIZE
NRF_ERROR_INVALID_STATE

Documentation feedback | Developer Zone | Subscribe | Updated