Bluetooth LE Profile API document
Bluetooth LE Profile API document Rev.1.00 [May 22, 2020]
Human Interface Device Service Server

This service exposes the HID reports and other HID data intended for HID Hosts and HID Devices. More...

Detailed Description

This service exposes the HID reports and other HID data intended for HID Hosts and HID Devices.

Data Structures

struct  st_ble_hids_evt_data_t
 Human Interface Device Service event data. More...
 
struct  st_ble_hids_connect_param_t
 Human Interface Device Service connection parameters. More...
 
struct  st_ble_hids_disconnect_param_t
 Human Interface Device Service disconnection parameters. More...
 
struct  st_ble_hids_init_param_t
 Human Interface Device Service initialization parameters. More...
 
struct  st_ble_hids_report_t
 Report characteristic parameters. More...
 
struct  st_ble_hids_report_report_reference_t
 Report Report Reference descriptor parameters. More...
 
struct  st_ble_hids_report_map_t
 Report Map characteristic parameters. More...
 
struct  st_ble_hids_boot_keyboard_input_report_t
 Boot Keyboard Input Report characteristic parameters. More...
 
struct  st_ble_hids_boot_keyboard_output_report_t
 Boot Keyboard Output Report characteristic parameters. More...
 
struct  st_ble_hids_boot_mouse_input_report_t
 Boot Mouse Input Report characteristic parameters. More...
 
struct  st_ble_hids_hid_information_t
 HID Information characteristic parameters. More...
 

Macros

#define BLE_HIDS_HID_INFORMATION_FLAGS_REMOTEWAKE   (1 << 0)
 RemoteWake bit. More...
 
#define BLE_HIDS_HID_INFORMATION_FLAGS_NORMALLYCONNECTABLE   (1 << 1)
 NormallyConnectable bit. More...
 

Typedefs

typedef void(* ble_hids_app_cb_t) (uint16_t type, ble_status_t result, st_ble_hids_evt_data_t *data)
 Human Interface Device Service event callback. More...
 

Enumerations

enum  e_ble_hids_event_t {
  BLE_HIDS_EVENT_REPORT_CLI_CNFG_ENABLED,
  BLE_HIDS_EVENT_REPORT_CLI_CNFG_DISABLED,
  BLE_HIDS_EVENT_BOOT_KEYBOARD_INPUT_REPORT_CLI_CNFG_ENABLED,
  BLE_HIDS_EVENT_BOOT_KEYBOARD_INPUT_REPORT_CLI_CNFG_DISABLED,
  BLE_HIDS_EVENT_BOOT_MOUSE_INPUT_REPORT_CLI_CNFG_ENABLED,
  BLE_HIDS_EVENT_BOOT_MOUSE_INPUT_REPORT_CLI_CNFG_DISABLED,
  BLE_HIDS_EVENT_REPORT_WRITE_REQ,
  BLE_HIDS_EVENT_BOOT_KEYBOARD_INPUT_REPORT_WRITE_REQ,
  BLE_HIDS_EVENT_BOOT_KEYBOARD_OUTPUT_REPORT_WRITE_REQ,
  BLE_HIDS_EVENT_BOOT_MOUSE_INPUT_REPORT_WRITE_REQ,
  BLE_HIDS_EVENT_PROTOCOL_MODE_WRITE_CMD,
  BLE_HIDS_EVENT_BOOT_KEYBOARD_OUTPUT_REPORT_WRITE_CMD,
  BLE_HIDS_EVENT_HID_CONTROL_POINT_WRITE_CMD,
  BLE_HIDS_EVENT_PROTOCOL_MODE_READ_REQ,
  BLE_HIDS_EVENT_REPORT_READ_REQ,
  BLE_HIDS_EVENT_REPORT_MAP_READ_REQ,
  BLE_HIDS_EVENT_BOOT_KEYBOARD_INPUT_REPORT_READ_REQ,
  BLE_HIDS_EVENT_BOOT_KEYBOARD_OUTPUT_REPORT_READ_REQ,
  BLE_HIDS_EVENT_BOOT_MOUSE_INPUT_REPORT_READ_REQ,
  BLE_HIDS_EVENT_HID_INFORMATION_READ_REQ
}
 Human Interface Device Service event type. More...
 
enum  e_ble_hids_protocol_mode_t {
  BLE_HIDS_PROTOCOL_MODE_PROTOCOL_MODE_VALUE_BOOT_PROTOCOL_MODE = 0,
  BLE_HIDS_PROTOCOL_MODE_PROTOCOL_MODE_VALUE_REPORT_PROTOCOL_MODE = 1
}
 Protocol Mode Value enumeration. More...
 
enum  e_ble_hids_hid_control_point_t {
  BLE_HIDS_HID_CONTROL_POINT_HID_CONTROL_POINT_COMMAND_SUSPEND = 0,
  BLE_HIDS_HID_CONTROL_POINT_HID_CONTROL_POINT_COMMAND_EXIT_SUSPEND = 1
}
 HID Control Point Command enumeration. More...
 

Functions

ble_status_t R_BLE_HIDS_Init (const st_ble_hids_init_param_t *p_param)
 Initialize Human Interface Device Service. More...
 
ble_status_t R_BLE_HIDS_Connect (uint16_t conn_hdl, uint8_t idx, const st_ble_hids_connect_param_t *p_param)
 Perform Human Interface Device Service connection settings. More...
 
ble_status_t R_BLE_HIDS_Disconnect (uint16_t conn_hdl, uint8_t idx, st_ble_hids_disconnect_param_t *p_param)
 Retrieve Human Interface Device Service connection specific settings before disconnection. More...
 
ble_status_t R_BLE_HIDS_GetProtocolMode (uint8_t idx, uint8_t *p_app_value)
 Get Protocol Mode characteristic value from local GATT database. More...
 
ble_status_t R_BLE_HIDS_SetProtocolMode (uint8_t idx, const uint8_t *p_app_value)
 Set Protocol Mode characteristic value to local GATT database. More...
 
ble_status_t R_BLE_HIDS_SetReport (uint8_t idx, uint8_t report_id, st_ble_gatt_value_t *p_app_value)
 Set Report characteristic value to local GATT database. More...
 
ble_status_t R_BLE_HIDS_NotifyReport (uint16_t conn_hdl, uint8_t idx, uint8_t report_id, const st_ble_gatt_value_t *p_app_value)
 Send Report notification. More...
 
ble_status_t R_BLE_HIDS_GetReportReportReference (uint8_t idx, uint8_t report_id, st_ble_hids_report_report_reference_t *p_app_value)
 Get Report characteristic Report Reference descriptor value from local GATT database. More...
 
ble_status_t R_BLE_HIDS_GetReportMap (uint8_t idx, st_ble_gatt_value_t *p_app_value)
 Get Report Map characteristic value from local GATT database. More...
 
ble_status_t R_BLE_HIDS_GetReportMapExternalReportReference (uint8_t idx, uint16_t *p_app_value)
 Get Report Map characteristic External Report Reference descriptor value from local GATT database. More...
 
ble_status_t R_BLE_HIDS_SetBootKeyboardInputReport (uint8_t idx, st_ble_gatt_value_t *p_app_value)
 Set Boot Keyboard Input Report characteristic value to local GATT database. More...
 
ble_status_t R_BLE_HIDS_NotifyBootKeyboardInputReport (uint16_t conn_hdl, uint8_t idx, const st_ble_gatt_value_t *p_app_value)
 Send Boot Keyboard Input Report notification. More...
 
ble_status_t R_BLE_HIDS_SetBootKeyboardOutputReport (uint8_t idx, st_ble_gatt_value_t *p_app_value)
 Set Boot Keyboard Output Report characteristic value to local GATT database. More...
 
ble_status_t R_BLE_HIDS_SetBootMouseInputReport (uint8_t idx, st_ble_gatt_value_t *p_app_value)
 Set Boot Mouse Input Report characteristic value to local GATT database. More...
 
ble_status_t R_BLE_HIDS_NotifyBootMouseInputReport (uint16_t conn_hdl, uint8_t idx, const st_ble_gatt_value_t *p_app_value)
 Send Boot Mouse Input Report notification. More...
 
ble_status_t R_BLE_HIDS_GetHidInformation (uint8_t idx, st_ble_hids_hid_information_t *p_app_value)
 Get HID Information characteristic value from local GATT database. More...
 
uint32_t R_BLE_HIDS_GetVersion (void)
 Return version of the HIDC service server. More...
 

Macro Definition Documentation

◆ BLE_HIDS_HID_INFORMATION_FLAGS_REMOTEWAKE

#define BLE_HIDS_HID_INFORMATION_FLAGS_REMOTEWAKE   (1 << 0)

RemoteWake bit.

◆ BLE_HIDS_HID_INFORMATION_FLAGS_NORMALLYCONNECTABLE

#define BLE_HIDS_HID_INFORMATION_FLAGS_NORMALLYCONNECTABLE   (1 << 1)

NormallyConnectable bit.

Typedef Documentation

◆ ble_hids_app_cb_t

typedef void(* ble_hids_app_cb_t) (uint16_t type, ble_status_t result, st_ble_hids_evt_data_t *data)

Human Interface Device Service event callback.

Enumeration Type Documentation

◆ e_ble_hids_event_t

Human Interface Device Service event type.

Enumerator
BLE_HIDS_EVENT_REPORT_CLI_CNFG_ENABLED 

Report characteristic cli cnfg enabled event

BLE_HIDS_EVENT_REPORT_CLI_CNFG_DISABLED 

Report characteristic cli cnfg disabled event

BLE_HIDS_EVENT_BOOT_KEYBOARD_INPUT_REPORT_CLI_CNFG_ENABLED 

Boot Keyboard Input Report characteristic cli cnfg enabled event

BLE_HIDS_EVENT_BOOT_KEYBOARD_INPUT_REPORT_CLI_CNFG_DISABLED 

Boot Keyboard Input Report characteristic cli cnfg disabled event

BLE_HIDS_EVENT_BOOT_MOUSE_INPUT_REPORT_CLI_CNFG_ENABLED 

Boot Mouse Input Report characteristic cli cnfg enabled event

BLE_HIDS_EVENT_BOOT_MOUSE_INPUT_REPORT_CLI_CNFG_DISABLED 

Boot Mouse Input Report characteristic cli cnfg disabled event

BLE_HIDS_EVENT_REPORT_WRITE_REQ 

Report characteristic write request event

BLE_HIDS_EVENT_BOOT_KEYBOARD_INPUT_REPORT_WRITE_REQ 

Boot Keyboard Input Report characteristic write request event

BLE_HIDS_EVENT_BOOT_KEYBOARD_OUTPUT_REPORT_WRITE_REQ 

Boot Keyboard Output Report characteristic write request event

BLE_HIDS_EVENT_BOOT_MOUSE_INPUT_REPORT_WRITE_REQ 

Boot Mouse Input Report characteristic write request event

BLE_HIDS_EVENT_PROTOCOL_MODE_WRITE_CMD 

Protocol Mode characteristic write command event

BLE_HIDS_EVENT_BOOT_KEYBOARD_OUTPUT_REPORT_WRITE_CMD 

Boot Keyboard Output Report characteristic write command event

BLE_HIDS_EVENT_HID_CONTROL_POINT_WRITE_CMD 

HID Control Point characteristic write command event

BLE_HIDS_EVENT_PROTOCOL_MODE_READ_REQ 

Protocol Mode characteristic read request event

BLE_HIDS_EVENT_REPORT_READ_REQ 

Report characteristic read request event

BLE_HIDS_EVENT_REPORT_MAP_READ_REQ 

Report Map characteristic read request event

BLE_HIDS_EVENT_BOOT_KEYBOARD_INPUT_REPORT_READ_REQ 

Boot Keyboard Input Report characteristic read request event

BLE_HIDS_EVENT_BOOT_KEYBOARD_OUTPUT_REPORT_READ_REQ 

Boot Keyboard Output Report characteristic read request event

BLE_HIDS_EVENT_BOOT_MOUSE_INPUT_REPORT_READ_REQ 

Boot Mouse Input Report characteristic read request event

BLE_HIDS_EVENT_HID_INFORMATION_READ_REQ 

HID Information characteristic read request event

◆ e_ble_hids_protocol_mode_t

Protocol Mode Value enumeration.

Enumerator
BLE_HIDS_PROTOCOL_MODE_PROTOCOL_MODE_VALUE_BOOT_PROTOCOL_MODE 

Boot Protocol Mode

BLE_HIDS_PROTOCOL_MODE_PROTOCOL_MODE_VALUE_REPORT_PROTOCOL_MODE 

Report Protocol Mode

◆ e_ble_hids_hid_control_point_t

HID Control Point Command enumeration.

Enumerator
BLE_HIDS_HID_CONTROL_POINT_HID_CONTROL_POINT_COMMAND_SUSPEND 

entering Suspend State

BLE_HIDS_HID_CONTROL_POINT_HID_CONTROL_POINT_COMMAND_EXIT_SUSPEND 

exiting Suspend State

Function Documentation

◆ R_BLE_HIDS_Init()

ble_status_t R_BLE_HIDS_Init ( const st_ble_hids_init_param_t p_param)

Initialize Human Interface Device Service.

This function shall be called once at startup.

Parameters
[in]paramHuman Interface Device Service initialization parameters.
Returns

◆ R_BLE_HIDS_Connect()

ble_status_t R_BLE_HIDS_Connect ( uint16_t  conn_hdl,
uint8_t  idx,
const st_ble_hids_connect_param_t p_param 
)

Perform Human Interface Device Service connection settings.

This function shall be called on each connection establishment.

Parameters
[in]conn_hdlConnection handle.
[in]paramConnection parameters.
Returns
ble_status_t

The Protocol Mode characteristic value shall be reset to the default value following connection establishment.

◆ R_BLE_HIDS_Disconnect()

ble_status_t R_BLE_HIDS_Disconnect ( uint16_t  conn_hdl,
uint8_t  idx,
st_ble_hids_disconnect_param_t p_param 
)

Retrieve Human Interface Device Service connection specific settings before disconnection.

This function shall be called on each disconnection.

Parameters
[in]conn_hdlConnection handle.
[in]paramDisconnection parameters.
Returns
ble_status_t

◆ R_BLE_HIDS_GetProtocolMode()

ble_status_t R_BLE_HIDS_GetProtocolMode ( uint8_t  idx,
uint8_t *  p_app_value 
)

Get Protocol Mode characteristic value from local GATT database.

Parameters
[out]app_valueRetrieved Protocol Mode characteristic value.
Returns
ble_status_t

◆ R_BLE_HIDS_SetProtocolMode()

ble_status_t R_BLE_HIDS_SetProtocolMode ( uint8_t  idx,
const uint8_t *  p_app_value 
)

Set Protocol Mode characteristic value to local GATT database.

Parameters
[in]app_valueProtocol Mode characteristic value to set.
Returns
ble_status_t

◆ R_BLE_HIDS_SetReport()

ble_status_t R_BLE_HIDS_SetReport ( uint8_t  idx,
uint8_t  report_id,
st_ble_gatt_value_t p_app_value 
)

Set Report characteristic value to local GATT database.

Parameters
[in]app_valueReport characteristic value to set.
Returns
ble_status_t

◆ R_BLE_HIDS_NotifyReport()

ble_status_t R_BLE_HIDS_NotifyReport ( uint16_t  conn_hdl,
uint8_t  idx,
uint8_t  report_id,
const st_ble_gatt_value_t p_app_value 
)

Send Report notification.

Parameters
[in]conn_hdlConnection handle.
[in]app_valueReport value to send.
Returns
ble_status_t

◆ R_BLE_HIDS_GetReportReportReference()

ble_status_t R_BLE_HIDS_GetReportReportReference ( uint8_t  idx,
uint8_t  report_id,
st_ble_hids_report_report_reference_t p_app_value 
)

Get Report characteristic Report Reference descriptor value from local GATT database.

Parameters
[out]app_valueRetrieved Report characteristic Report Reference value.
Returns
ble_status_t

◆ R_BLE_HIDS_GetReportMap()

ble_status_t R_BLE_HIDS_GetReportMap ( uint8_t  idx,
st_ble_gatt_value_t p_app_value 
)

Get Report Map characteristic value from local GATT database.

Parameters
[out]app_valueRetrieved Report Map characteristic value.
Returns
ble_status_t

◆ R_BLE_HIDS_GetReportMapExternalReportReference()

ble_status_t R_BLE_HIDS_GetReportMapExternalReportReference ( uint8_t  idx,
uint16_t *  p_app_value 
)

Get Report Map characteristic External Report Reference descriptor value from local GATT database.

Parameters
[out]p_app_valueRetrieved Report Map characteristic External Report Reference value.
Returns
ble_status_t

◆ R_BLE_HIDS_SetBootKeyboardInputReport()

ble_status_t R_BLE_HIDS_SetBootKeyboardInputReport ( uint8_t  idx,
st_ble_gatt_value_t p_app_value 
)

Set Boot Keyboard Input Report characteristic value to local GATT database.

Parameters
[in]app_valueBoot Keyboard Input Report characteristic value to set.
Returns
ble_status_t

◆ R_BLE_HIDS_NotifyBootKeyboardInputReport()

ble_status_t R_BLE_HIDS_NotifyBootKeyboardInputReport ( uint16_t  conn_hdl,
uint8_t  idx,
const st_ble_gatt_value_t p_app_value 
)

Send Boot Keyboard Input Report notification.

Parameters
[in]conn_hdlConnection handle.
[in]app_valueBoot Keyboard Input Report value to send.
Returns
ble_status_t

◆ R_BLE_HIDS_SetBootKeyboardOutputReport()

ble_status_t R_BLE_HIDS_SetBootKeyboardOutputReport ( uint8_t  idx,
st_ble_gatt_value_t p_app_value 
)

Set Boot Keyboard Output Report characteristic value to local GATT database.

Parameters
[in]app_valueBoot Keyboard Output Report characteristic value to set.
Returns
ble_status_t

◆ R_BLE_HIDS_SetBootMouseInputReport()

ble_status_t R_BLE_HIDS_SetBootMouseInputReport ( uint8_t  idx,
st_ble_gatt_value_t p_app_value 
)

Set Boot Mouse Input Report characteristic value to local GATT database.

Parameters
[in]app_valueBoot Mouse Input Report characteristic value to set.
Returns
ble_status_t

◆ R_BLE_HIDS_NotifyBootMouseInputReport()

ble_status_t R_BLE_HIDS_NotifyBootMouseInputReport ( uint16_t  conn_hdl,
uint8_t  idx,
const st_ble_gatt_value_t p_app_value 
)

Send Boot Mouse Input Report notification.

Parameters
[in]conn_hdlConnection handle.
[in]app_valueBoot Mouse Input Report value to send.
Returns
ble_status_t

◆ R_BLE_HIDS_GetHidInformation()

ble_status_t R_BLE_HIDS_GetHidInformation ( uint8_t  idx,
st_ble_hids_hid_information_t p_app_value 
)

Get HID Information characteristic value from local GATT database.

Parameters
[out]app_valueRetrieved HID Information characteristic value.
Returns
ble_status_t

◆ R_BLE_HIDS_GetVersion()

uint32_t R_BLE_HIDS_GetVersion ( void  )

Return version of the HIDC service server.

Returns
version