Cordio Stack and Cordio Profiles  r2p3-02rel0
Human Interface Device Profile

Data Structures

struct  hidReportIdMap_t
 HID Report Type/ID to Attribute handle map item. More...
 
struct  hidConfig_t
 HID Profile Configuration. More...
 

Typedefs

typedef void(* hidOutputReportCback_t) (dmConnId_t connId, uint8_t id, uint16_t len, uint8_t *pReport)
 This callback function sends a received Output Report to the application. More...
 
typedef void(* hidFeatureReportCback_t) (dmConnId_t connId, uint8_t id, uint16_t len, uint8_t *pReport)
 This callback function sends a received Feature Report to the application. More...
 
typedef void(* hidInfoCback_t) (dmConnId_t connId, uint8_t type, uint8_t value)
 This callback function notifies the application of a change in the protocol mode or control point from the host. More...
 

Functions

void HidSendInputReport (dmConnId_t connId, uint8_t reportId, uint16_t len, uint8_t *pValue)
 Sends an input report to the host. More...
 
void HidSetProtocolMode (uint8_t protocolMode)
 Sets the HID protocol mode for keyboard and mouse devices that support Boot Mode. More...
 
uint8_t HidGetProtocolMode (void)
 Gets the HID protocol mode value. More...
 
uint8_t HidGetControlPoint (void)
 Gets the HID control point value. More...
 
void HidInit (const hidConfig_t *pConfig)
 Initialize the HID profile. More...
 
uint8_t HidAttsWriteCback (dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset, uint16_t len, uint8_t *pValue, attsAttr_t *pAttr)
 Called on an ATTS Write to the HID Service. More...
 

Type of HID Information

#define HID_INFO_CONTROL_POINT   0
 Control point information.
 
#define HID_INFO_PROTOCOL_MODE   1
 Protocol mode information.
 

HID Boot Report ID

#define HID_KEYBOARD_BOOT_ID   0xFF
 Keyboard boot ID.
 
#define HID_MOUSE_BOOT_ID   0xFE
 Mouse boot ID.
 

Description

The HID, Human Interface Device, Profile provides functions to support HID Devices such as Keyboards, Computer Mice, and Remote Controls.

Typedef Documentation

typedef void(* hidOutputReportCback_t) (dmConnId_t connId, uint8_t id, uint16_t len, uint8_t *pReport)

This callback function sends a received Output Report to the application.

Parameters
connIdThe connection identifier.
idThe ID of the report.
lenThe length of the report data in pReport.
pReportA buffer containing the report.
Returns
None.

Definition at line 65 of file hid_api.h.

typedef void(* hidFeatureReportCback_t) (dmConnId_t connId, uint8_t id, uint16_t len, uint8_t *pReport)

This callback function sends a received Feature Report to the application.

Parameters
connIdThe connection identifier.
idThe ID of the report.
lenThe length of the report data in pReport.
pReportA buffer containing the report.
Returns
None.

Definition at line 79 of file hid_api.h.

typedef void(* hidInfoCback_t) (dmConnId_t connId, uint8_t type, uint8_t value)

This callback function notifies the application of a change in the protocol mode or control point from the host.

Parameters
connIdThe connection identifier.
modeThe type of information (HID_INFO_CONTROL_POINT or HID_INFO_PROTOCOL_MODE)
valueThe value of the information
Returns
None.

Definition at line 93 of file hid_api.h.

Function Documentation

void HidSendInputReport ( dmConnId_t  connId,
uint8_t  reportId,
uint16_t  len,
uint8_t pValue 
)

Sends an input report to the host.

Parameters
connIdThe connection ID
reportIdThe Report ID
lenThe length of the report in bytes
pValueA buffer containing the report
Returns
none.
void HidSetProtocolMode ( uint8_t  protocolMode)

Sets the HID protocol mode for keyboard and mouse devices that support Boot Mode.

Parameters
protocolModeThe protocol mode (HID_PROTOCOL_MODE_REPORT or HID_PROTOCOL_MODE_BOOT)
Returns
None.
uint8_t HidGetProtocolMode ( void  )

Gets the HID protocol mode value.

Returns
The protocol mode value (HID_PROTOCOL_MODE_REPORT or HID_PROTOCOL_MODE_BOOT).
uint8_t HidGetControlPoint ( void  )

Gets the HID control point value.

Returns
The control point value (HID_CONTROL_POINT_SUSPEND or HID_CONTROL_POINT_RESUME).
void HidInit ( const hidConfig_t pConfig)

Initialize the HID profile.

Parameters
pConfigHID Configuration structure
Returns
None.
uint8_t HidAttsWriteCback ( dmConnId_t  connId,
uint16_t  handle,
uint8_t  operation,
uint16_t  offset,
uint16_t  len,
uint8_t pValue,
attsAttr_t pAttr 
)

Called on an ATTS Write to the HID Service.

Parameters
connIdDM connection identifier.
handleATT handle.
operationATT operation.
offsetWrite offset.
lenWrite length.
pValueValue to write.
pAttrAttribute to write.
Returns
ATT status.