InPlay API
BLE HOG Profile

BLE HOG Profile. More...

Data Structures

struct  ble_hogpbh_boot_report_t
 HOGP Boot Host HID boot report info. More...
 
struct  ble_hogpd_info_t
 HID Information structure. More...
 
struct  ble_hogpd_ext_ref_t
 External Report Reference. More...
 
struct  ble_hogpd_cfg_t
 Database Creation Service Instance Configuration structure. More...
 
struct  ble_hogpd_report_info_t
 HID Report Info. More...
 
struct  ble_evt_hogpd_proto_mode_req_ind_t
 Inform Device APP that Protocol Mode Characteristic Value has been written on Device. More...
 
struct  ble_hogprh_content_t
 Structure containing the characteristics handles, value handles and descriptors. More...
 
struct  ble_hogprh_report_t
 HID report info. More...
 
struct  ble_hogprh_report_ref_t
 HID report Reference. More...
 
struct  ble_hogprh_report_map_t
 HID report MAP info. More...
 
struct  ble_hogprh_report_map_ref_t
 HID report MAP reference. More...
 
struct  ble_evt_hogprh_report_ind_t
 Parameters of the HOGPRH_BOOT_REPORT_IND message. More...
 

Macros

#define BLE_HOGPRH_NB_HIDS_INST_MAX   (2)
 Maximal number of hids instances that can be handled.
 
#define BLE_HOGPRH_NB_REPORT_INST_MAX   (5)
 Maximal number of Report Char. that can be added in the DB for one HIDS - Up to 11.
 
#define BLE_HOGPRH_REPORT_MAP_MAX_LEN   (512)
 Maximal length of Report Map Char. Value.
 
#define BLE_HOGPD_NB_HIDS_INST_MAX   (2)
 
#define BLE_HOGPD_NB_REPORT_INST_MAX   (5)
 Maximal number of Report Char. that can be added in the DB for one HIDS - Up to 11.
 

Enumerations

enum  ble_hog_evt_code { ,
  HOGPBH_EVT_BOOT_REPORT_IND , HOGPRH_EVT_REPORT_IND , HOGPD_EVT_REPORT_REQ_IND, HOGPD_EVT_PROTO_MODE_UPD_IND,
  HOGPD_EVT_NTF_CFG_IND, HOGPD_EVT_CNTL_PT_IND
}
 Event code. More...
 
enum  ble_hogp_info_bit { BLE_HIDS_REMOTE_WAKE_CAPABLE = 0x01, BLE_HIDS_NORM_CONNECTABLE = 0x02 }
 HID Information bit values. More...
 
enum  ble_hogp_ctnl_pt { BLE_HOGP_CTNL_PT_SUSPEND = 0x00, BLE_HOGP_CTNL_PT_EXIT_SUSPEND }
 HID Control Point Characteristic value keys. More...
 
enum  ble_hogp_boot_prot_mode { BLE_HOGP_BOOT_PROTOCOL_MODE = 0x00, BLE_HOGP_REPORT_PROTOCOL_MODE }
 Protocol Mode Char. value Keys. More...
 
enum  ble_hogpbh_chars { BLE_HOGPBH_CHAR_PROTO_MODE, BLE_HOGPBH_CHAR_BOOT_KB_IN_REPORT, BLE_HOGPBH_CHAR_BOOT_KB_OUT_REPORT, BLE_HOGPBH_CHAR_BOOT_MOUSE_IN_REPORT }
 HOGP Boot Host Characteristics. More...
 
enum  ble_hogpbh_descs { BLE_HOGPBH_DESC_BOOT_KB_IN_REPORT_CFG, BLE_HOGPBH_DESC_BOOT_MOUSE_IN_REPORT_CFG }
 HOGP Boot Host Characteristic descriptors. More...
 
enum  ble_hogpbh_info {
  BLE_HOGPBH_PROTO_MODE, BLE_HOGPBH_BOOT_KB_IN_REPORT, BLE_HOGPBH_BOOT_KB_OUT_REPORT, BLE_HOGPBH_BOOT_MOUSE_IN_REPORT,
  BLE_HOGPBH_BOOT_KB_IN_NTF_CFG, BLE_HOGPBH_BOOT_MOUSE_IN_NTF_CFG
}
 HOGP Boot Host Peer HID service info that can be read/write. More...
 
enum  ble_hogpd_cfg {
  BLE_HOGPD_CFG_KEYBOARD = 0x01, BLE_HOGPD_CFG_MOUSE = 0x02, BLE_HOGPD_CFG_PROTO_MODE = 0x04, BLE_HOGPD_CFG_MAP_EXT_REF = 0x08,
  BLE_HOGPD_CFG_BOOT_KB_WR = 0x10, BLE_HOGPD_CFG_BOOT_MOUSE_WR = 0x20, BLE_HOGPD_CFG_MASK = 0x3F, BLE_HOGPD_CFG_REPORT_NTF_EN = 0x40
}
 HOGPD config. More...
 
enum  ble_hogpd_report_cfg { BLE_HOGPD_CFG_REPORT_IN = 0x01, BLE_HOGPD_CFG_REPORT_OUT = 0x02, BLE_HOGPD_CFG_REPORT_FEAT = 0x03, BLE_HOGPD_CFG_REPORT_WR = 0x10 }
 Report Char. Configuration Flag Values. More...
 
enum  ble_hogpd_report_type {
  BLE_HOGPD_REPORT, BLE_HOGPD_REPORT_MAP, BLE_HOGPD_BOOT_KEYBOARD_INPUT_REPORT, BLE_HOGPD_BOOT_KEYBOARD_OUTPUT_REPORT,
  BLE_HOGPD_BOOT_MOUSE_INPUT_REPORT
}
 Type of reports. More...
 
enum  ble_hogpd_op { BLE_HOGPD_OP_NO, BLE_HOGPD_OP_REPORT_READ, BLE_HOGPD_OP_REPORT_WRITE, BLE_HOGPD_OP_PROT_UPDATE }
 type of operation requested by peer device More...
 
enum  ble_hogprh_chars {
  BLE_HOGPRH_CHAR_REPORT_MAP, BLE_HOGPRH_CHAR_HID_INFO, BLE_HOGPRH_CHAR_HID_CTNL_PT, BLE_HOGPRH_CHAR_PROTOCOL_MODE,
  BLE_HOGPRH_CHAR_REPORT
}
 HOG profile report host Characteristics. More...
 
enum  ble_hogprh_descs { BLE_HOGPRH_DESC_REPORT_MAP_EXT_REP_REF, BLE_HOGPRH_DESC_REPORT_REF, BLE_HOGPRH_DESC_REPORT_CFG = BLE_HOGPRH_DESC_REPORT_REF + BLE_HOGPRH_NB_REPORT_INST_MAX }
 Characteristic descriptors. More...
 
enum  ble_hogprh_info {
  BLE_HOGPRH_PROTO_MODE, BLE_HOGPRH_REPORT_MAP, BLE_HOGPRH_REPORT_MAP_EXT_REP_REF, BLE_HOGPRH_HID_INFO,
  BLE_HOGPRH_HID_CTNL_PT, BLE_HOGPRH_REPORT, BLE_HOGPRH_REPORT_REF, BLE_HOGPRH_REPORT_NTF_CFG
}
 Peer HID service info that can be read/write. More...
 

Functions

int in_ble_hogpbh_add (void *hdl, ble_hogp_prf_t *p_prf, comp_cb callback)
 Add HOGPBH profile. More...
 
int in_ble_hogpbh_enable (void *hdl, int conidx, int con_type, uint8_t hids_nb, ble_hogpbh_content_t cont[], comp_cb callback)
 Enable HOGPBH profile. More...
 
int in_ble_hogpbh_read_info_req (void *hdl, int conidx, int hid_idx, int info, ble_hogpbh_read_info_rsp_t *p_rsp, comp_cb callback)
 Read peer info. More...
 
int in_ble_hogpbh_write_req (void *hdl, int conidx, int hid_idx, int info, int wr_cmd, ble_hogpbh_data_t *p_data, comp_cb callback)
 Write info to peer. More...
 
int in_ble_hogpd_add (void *hdl, ble_hogp_prf_t *p_prf, comp_cb callback)
 Add HOGPD profile. More...
 
int in_ble_hogpd_enable (void *hdl, int conidx, uint16_t ntf_cfg[], comp_cb callback)
 Enable HOGPBH profile. More...
 
int in_ble_hogpd_report_upd_req (void *hdl, int conidx, ble_hogpd_report_info_t *p_info, comp_cb callback)
 Request sending of a report to the host - notification. More...
 
int in_ble_hogpd_report_req_cfm (void *hdl, int conidx, int operation, int status, ble_hogpd_report_info_t *p_info)
 Confirmation for peer device for Reading or Updating a report value. More...
 
int in_ble_hogpd_proto_mode_req_cfm (void *hdl, int conidx, int status, int hid_idx, int proto_mode)
 Confirm if the new protocol mode value. More...
 
int in_ble_hogprh_add (void *hdl, ble_hogp_prf_t *p_prf, comp_cb callback)
 Add HOGPRH profile. More...
 
int in_ble_hogprh_enable (void *hdl, int conidx, int con_type, int hids_nb, ble_hogprh_content_t cont[], comp_cb callback)
 Enable HOGPRH profile. More...
 
int in_ble_hogprh_read_info_req (void *hdl, int conidx, ble_hogprh_read_info_req_t *p_req, ble_hogprh_read_info_rsp_t *p_rsp, comp_cb callback)
 Read peer info. More...
 
int in_ble_hogprh_write_req (void *hdl, int conidx, ble_hogprh_write_req_t *p_req, comp_cb callback)
 Write info to peer. More...
 

Detailed Description

BLE HOG Profile.

Macro Definition Documentation

◆ BLE_HOGPD_NB_HIDS_INST_MAX

#define BLE_HOGPD_NB_HIDS_INST_MAX   (2)

HOGP Devicet role Maximal number of HIDS that can be added in the DB

Enumeration Type Documentation

◆ ble_hog_evt_code

Event code.

Enumerator
HOGPBH_EVT_BOOT_REPORT_IND 

Boot Report value (after Read Request or Notification),.

See also
in_ble_evt_hogpbh_boot_report_ind_t
HOGPRH_EVT_REPORT_IND 

Report value (after Notification),.

See also
in_ble_evt_hogprh_report_ind_t
HOGPD_EVT_REPORT_REQ_IND 

Request from peer device to Read or update a report value,.

See also
in_ble_evt_hogpd_report_req_ind_t
HOGPD_EVT_PROTO_MODE_UPD_IND 

Inform Device that Protocol Mode Characteristic Value has been written on Device,.

See also
in_ble_evt_hogpd_proto_mode_req_ind_t
HOGPD_EVT_NTF_CFG_IND 

Inform Device that a Client Characteristic Configuration has been modified,.

See also
in_ble_evt_hogpd_ntf_cfg_ind_t
HOGPD_EVT_CNTL_PT_IND 

Inform that HID Control Point Characteristic Value has been written on Device,.

See also
in_ble_evt_hogpd_ctnl_pt_ind_t

◆ ble_hogp_boot_prot_mode

Protocol Mode Char. value Keys.

Enumerator
BLE_HOGP_BOOT_PROTOCOL_MODE 

Boot Protocol Mode.

BLE_HOGP_REPORT_PROTOCOL_MODE 

Report Protocol Mode.

◆ ble_hogp_ctnl_pt

HID Control Point Characteristic value keys.

Enumerator
BLE_HOGP_CTNL_PT_SUSPEND 

Suspend.

BLE_HOGP_CTNL_PT_EXIT_SUSPEND 

Exit suspend.

◆ ble_hogp_info_bit

HID Information bit values.

Enumerator
BLE_HIDS_REMOTE_WAKE_CAPABLE 

Device capable of providing wake-up signal to a HID host.

BLE_HIDS_NORM_CONNECTABLE 

Normally connectable support bit.

◆ ble_hogpbh_chars

HOGP Boot Host Characteristics.

Enumerator
BLE_HOGPBH_CHAR_PROTO_MODE 

Protocol Mode.

BLE_HOGPBH_CHAR_BOOT_KB_IN_REPORT 

Boot Keyboard Input Report.

BLE_HOGPBH_CHAR_BOOT_KB_OUT_REPORT 

Boot Keyboard Output Report.

BLE_HOGPBH_CHAR_BOOT_MOUSE_IN_REPORT 

Boot Mouse Input Report.

◆ ble_hogpbh_descs

HOGP Boot Host Characteristic descriptors.

Enumerator
BLE_HOGPBH_DESC_BOOT_KB_IN_REPORT_CFG 

Boot Keyboard Input Report Client Config.

BLE_HOGPBH_DESC_BOOT_MOUSE_IN_REPORT_CFG 

Boot Mouse Input Report Client Config.

◆ ble_hogpbh_info

HOGP Boot Host Peer HID service info that can be read/write.

Enumerator
BLE_HOGPBH_PROTO_MODE 

Protocol Mode.

BLE_HOGPBH_BOOT_KB_IN_REPORT 

Boot Keyboard Input Report.

BLE_HOGPBH_BOOT_KB_OUT_REPORT 

Boot Keyboard Output Report.

BLE_HOGPBH_BOOT_MOUSE_IN_REPORT 

Boot Mouse Input Report.

BLE_HOGPBH_BOOT_KB_IN_NTF_CFG 

Boot Keyboard Input Report Client Config.

BLE_HOGPBH_BOOT_MOUSE_IN_NTF_CFG 

Boot Mouse Input Report Client Config.

◆ ble_hogpd_cfg

HOGPD config.

Enumerator
BLE_HOGPD_CFG_KEYBOARD 

Keyboard Device.

BLE_HOGPD_CFG_MOUSE 

Mouse Device.

BLE_HOGPD_CFG_PROTO_MODE 

Protocol Mode present.

BLE_HOGPD_CFG_MAP_EXT_REF 

Extended Reference Present.

BLE_HOGPD_CFG_BOOT_KB_WR 

Boot Keyboard Report write capability.

BLE_HOGPD_CFG_BOOT_MOUSE_WR 

Boot Mouse Report write capability.

BLE_HOGPD_CFG_MASK 

Valid Feature mask.

BLE_HOGPD_CFG_REPORT_NTF_EN 

Report Notification Enabled (to be shift for each report index)

◆ ble_hogpd_op

type of operation requested by peer device

Enumerator
BLE_HOGPD_OP_NO 

No operation.

BLE_HOGPD_OP_REPORT_READ 

Read report value.

BLE_HOGPD_OP_REPORT_WRITE 

Modify/Set report value.

BLE_HOGPD_OP_PROT_UPDATE 

Modify Protocol mode.

◆ ble_hogpd_report_cfg

Report Char. Configuration Flag Values.

Enumerator
BLE_HOGPD_CFG_REPORT_IN 

Input Report.

BLE_HOGPD_CFG_REPORT_OUT 

Output Report.

BLE_HOGPD_CFG_REPORT_FEAT 

Feature Report.

BLE_HOGPD_CFG_REPORT_WR 

Input report with Write capabilities.

◆ ble_hogpd_report_type

Type of reports.

Enumerator
BLE_HOGPD_REPORT 

The Report characteristic is used to exchange data between a HID Device and a HID Host.

BLE_HOGPD_REPORT_MAP 

The Report Map characteristic.

BLE_HOGPD_BOOT_KEYBOARD_INPUT_REPORT 

Boot Keyboard Input Report.

BLE_HOGPD_BOOT_KEYBOARD_OUTPUT_REPORT 

Boot Keyboard Output Report.

BLE_HOGPD_BOOT_MOUSE_INPUT_REPORT 

Boot Mouse Input Report.

◆ ble_hogprh_chars

HOG profile report host Characteristics.

Enumerator
BLE_HOGPRH_CHAR_REPORT_MAP 

Report Map.

BLE_HOGPRH_CHAR_HID_INFO 

HID Information.

BLE_HOGPRH_CHAR_HID_CTNL_PT 

HID Control Point.

BLE_HOGPRH_CHAR_PROTOCOL_MODE 

Protocol Mode.

BLE_HOGPRH_CHAR_REPORT 

Report.

◆ ble_hogprh_descs

Characteristic descriptors.

Enumerator
BLE_HOGPRH_DESC_REPORT_MAP_EXT_REP_REF 

Report Map Char. External Report Reference Descriptor.

BLE_HOGPRH_DESC_REPORT_REF 

Report Char. Report Reference.

BLE_HOGPRH_DESC_REPORT_CFG 

Report Client Config.

◆ ble_hogprh_info

Peer HID service info that can be read/write.

Enumerator
BLE_HOGPRH_PROTO_MODE 

Protocol Mode.

BLE_HOGPRH_REPORT_MAP 

Report Map.

BLE_HOGPRH_REPORT_MAP_EXT_REP_REF 

Report Map Char. External Report Reference Descriptor.

BLE_HOGPRH_HID_INFO 

HID Information.

BLE_HOGPRH_HID_CTNL_PT 

HID Control Point.

BLE_HOGPRH_REPORT 

Report.

BLE_HOGPRH_REPORT_REF 

Report Char. Report Reference.

BLE_HOGPRH_REPORT_NTF_CFG 

Report Notification config.

Function Documentation

◆ in_ble_hogpbh_add()

int in_ble_hogpbh_add ( void *  hdl,
ble_hogp_prf_t *  p_prf,
comp_cb  callback 
)

Add HOGPBH profile.

Note
Add it after device configuration, but before any activity starts
Parameters
[in]p_prfPointer to profile attributes,
See also
ble_hogp_prf_t
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err

◆ in_ble_hogpbh_enable()

int in_ble_hogpbh_enable ( void *  hdl,
int  conidx,
int  con_type,
uint8_t  hids_nb,
ble_hogpbh_content_t  cont[],
comp_cb  callback 
)

Enable HOGPBH profile.

Note
First function to call after connection
Parameters
[in]conidxConnection index
[in]con_typeConnnetion type,
See also
enum ble_con_type
Parameters
[in]hids_nbNumber of profile to enable
[in,out]contContents of service
  • Discover connection type: Stack will fill it
  • Normal connection type: Application needs to fill it.
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err

◆ in_ble_hogpbh_read_info_req()

int in_ble_hogpbh_read_info_req ( void *  hdl,
int  conidx,
int  hid_idx,
int  info,
ble_hogpbh_read_info_rsp_t *  p_rsp,
comp_cb  callback 
)

Read peer info.

Parameters
[in]conidxConnection index
[in]hid_idxInstance index
[in]infoInformation to read,
See also
enum ble_hogprh_info
Parameters
[out]p_rspReponse from the peere
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_hogpbh_write_req()

int in_ble_hogpbh_write_req ( void *  hdl,
int  conidx,
int  hid_idx,
int  info,
int  wr_cmd,
ble_hogpbh_data_t *  p_data,
comp_cb  callback 
)

Write info to peer.

Parameters
[in]conidxConnection index
[in]hid_idxIndex
[in]infoInformation to write,
See also
enum ble_hogprh_info
Parameters
[in]wr_cmdWrite command 1 - write request no response 0 - write request
[in]p_dataWrite data
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err

◆ in_ble_hogpd_add()

int in_ble_hogpd_add ( void *  hdl,
ble_hogp_prf_t *  p_prf,
comp_cb  callback 
)

Add HOGPD profile.

Note
Add it after device configuration, but before any activity starts
Parameters
[in]p_prfPointer to profile attributes,
See also
ble_hogp_prf_t
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err

◆ in_ble_hogpd_enable()

int in_ble_hogpd_enable ( void *  hdl,
int  conidx,
uint16_t  ntf_cfg[],
comp_cb  callback 
)

Enable HOGPBH profile.

Note
First function to call after connection
Parameters
[in]conidxConnection index
[in]ntf_cfgNotifiction configuraton,
See also
enum in_ble_hogpd_cfg
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err

◆ in_ble_hogpd_proto_mode_req_cfm()

int in_ble_hogpd_proto_mode_req_cfm ( void *  hdl,
int  conidx,
int  status,
int  hid_idx,
int  proto_mode 
)

Confirm if the new protocol mode value.

Parameters
[in]conidxConnection index
[in]statusStatus of the request
[in]hid_idxHIDS Instance
[in]proto_modeNew Protocol Mode Characteristic Value
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_hogpd_report_req_cfm()

int in_ble_hogpd_report_req_cfm ( void *  hdl,
int  conidx,
int  operation,
int  status,
ble_hogpd_report_info_t p_info 
)

Confirmation for peer device for Reading or Updating a report value.

Parameters
[in]conidxConnection index
[in]operationOperation requested,
See also
enum in_ble_hogpd_op
Parameters
[in]statusStatus of the request
[in]p_infoReport Info
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err

◆ in_ble_hogpd_report_upd_req()

int in_ble_hogpd_report_upd_req ( void *  hdl,
int  conidx,
ble_hogpd_report_info_t p_info,
comp_cb  callback 
)

Request sending of a report to the host - notification.

Parameters
[in]conidxConnection index
[in]p_infoReport info
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err

◆ in_ble_hogprh_add()

int in_ble_hogprh_add ( void *  hdl,
ble_hogp_prf_t *  p_prf,
comp_cb  callback 
)

Add HOGPRH profile.

Note
Add it after device configuration, but before any activity starts
Parameters
[in]p_prfPointer to profile attributes,
See also
ble_hogp_prf_t
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err

◆ in_ble_hogprh_enable()

int in_ble_hogprh_enable ( void *  hdl,
int  conidx,
int  con_type,
int  hids_nb,
ble_hogprh_content_t  cont[],
comp_cb  callback 
)

Enable HOGPRH profile.

Note
First function to call after connection
Parameters
[in]conidxConnection index
[in]con_typeConnnetion type,
See also
enum ble_con_type
Parameters
[in]hids_nbNumber of instances
[in,out]contContents of service
  • Discover connection type: Stack will fill it
  • Normal connection type: Application needs to fill it.
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_hogprh_read_info_req()

int in_ble_hogprh_read_info_req ( void *  hdl,
int  conidx,
ble_hogprh_read_info_req_t *  p_req,
ble_hogprh_read_info_rsp_t *  p_rsp,
comp_cb  callback 
)

Read peer info.

Parameters
[in]conidxConnection index
[in]p_reqRequest information
[out]p_rspReponse from the peere
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_hogprh_write_req()

int in_ble_hogprh_write_req ( void *  hdl,
int  conidx,
ble_hogprh_write_req_t *  p_req,
comp_cb  callback 
)

Write info to peer.

Parameters
[in]conidxConnection index
[in]p_reqWrite information
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t