Infineon Logo AIROC BTSDK v4.2 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
wiced_bt_hidd.h File Reference

Human Interface Device Profile (HID) Device over BR/EDR. More...

Data Structures

struct  wiced_bt_hidd_qos_info_t
 HIDD QoS configuration. More...
 
struct  wiced_bt_rep_data
 HID-Device Response data. More...
 
struct  wiced_bt_hidd_data_t
 Incoming data. More...
 
union  wiced_bt_hidd_event_data_t
 Data types for HIDD event callback. More...
 
struct  wiced_bt_hidd_reg_info_t
 HIDD device registration information. More...
 
struct  wiced_bt_hidd_pwr_md
 

Macros

#define HID_TRANS_HANDSHAKE   (0)
 Define the HID transaction types (see Table 3.1 Bluetooth HID Protocol Message type in the spec)
 
#define HID_TRANS_CONTROL   (1)
 
#define HID_TRANS_GET_REPORT   (4)
 
#define HID_TRANS_SET_REPORT   (5)
 
#define HID_TRANS_GET_PROTOCOL   (6)
 
#define HID_TRANS_SET_PROTOCOL   (7)
 
#define HID_TRANS_GET_IDLE   (8)
 
#define HID_TRANS_SET_IDLE   (9)
 
#define HID_TRANS_DATA   (10)
 
#define HID_TRANS_DATAC   (11)
 
#define HID_GET_TRANS_FROM_HDR(x)   ((x >> 4) & 0x0f)
 
#define HID_GET_PARAM_FROM_HDR(x)   (x & 0x0f)
 
#define HID_BUILD_HDR(t, p)   (uint8_t)((t << 4) | (p & 0x0f))
 
#define HID_HDR_LEN   (1)
 
#define HID_PAR_HANDSHAKE_RSP_SUCCESS   (0)
 Parameters for Handshake. More...
 
#define HID_PAR_HANDSHAKE_RSP_NOT_READY   (1)
 Device is busy to accept data.
 
#define HID_PAR_HANDSHAKE_RSP_ERR_INVALID_REP_ID   (2)
 Invalid report ID transmitted.
 
#define HID_PAR_HANDSHAKE_RSP_ERR_UNSUPPORTED_REQ   (3)
 The device does not support the request.
 
#define HID_PAR_HANDSHAKE_RSP_ERR_INVALID_PARAM   (4)
 Parameter value is out of range or inappropriate for the request. More...
 
#define HID_PAR_HANDSHAKE_RSP_ERR_UNKNOWN   (14)
 Device could not identify the error condition.
 
#define HID_PAR_HANDSHAKE_RSP_ERR_FATAL   (15)
 Restart is essential to resume functionality.
 
#define HID_PAR_CONTROL_NOP   (0)
 Parameters for Control. More...
 
#define HID_PAR_CONTROL_HARD_RESET   (1)
 Perform Hard Reset.
 
#define HID_PAR_CONTROL_SOFT_RESET   (2)
 Perform Soft Reset.
 
#define HID_PAR_CONTROL_SUSPEND   (3)
 Go to reduced power mode.
 
#define HID_PAR_CONTROL_EXIT_SUSPEND   (4)
 Exit reduced power mode.
 
#define HID_PAR_CONTROL_VIRTUAL_CABLE_UNPLUG   (5)
 Destroys or invalidate all bonding and Virtual Cable information.
 
#define HID_PAR_REP_TYPE_MASK   (0x03)
 Different report types in get, set, data. More...
 
#define HID_PAR_REP_TYPE_OTHER   (0x00)
 Other report type.
 
#define HID_PAR_REP_TYPE_INPUT   (0x01)
 Input report type.
 
#define HID_PAR_REP_TYPE_OUTPUT   (0x02)
 Output report type.
 
#define HID_PAR_REP_TYPE_FEATURE   (0x03)
 Feature report type.
 
#define HID_PAR_GET_REP_BUFSIZE_FOLLOWS   (0x08) /** Buffer size in two bytes after Report ID */
 Parameters for Get Report.
 
#define HID_PAR_PROTOCOL_MASK   (0x01)
 Parameters for Protocol Type. More...
 
#define HID_PAR_PROTOCOL_REPORT   (0x01)
 Report protocol mode, default mode.
 
#define HID_PAR_PROTOCOL_BOOT_MODE   (0x00)
 Boot protocol mode.
 
#define HID_SDP_DESCRIPTOR_REPORT   (0x22)
 Descriptor types in the SDP record (see Table 5.6: Descriptor Type Codes) More...
 
#define HID_SDP_DESCRIPTOR_PHYSICAL   (0x23)
 Descriptor type physical.
 

Typedefs

typedef uint8_t wiced_bt_hidd_status_t
 HIDD status codes (see wiced_bt_hidd_status_e)
 
typedef struct wiced_bt_rep_data wiced_bt_hidd_get_rep_data_t
 HID-Device Response data. More...
 
typedef uint8_t wiced_bt_hidd_cback_event_t
 HIDD events (see wiced_bt_hidd_cback_event_e)
 
typedef uint8_t wiced_bt_hidd_st_t
 
typedef void( wiced_bt_hidd_callback_t )(wiced_bt_hidd_cback_event_t event, uint32_t data, wiced_bt_hidd_event_data_t *p_event_data)
 HIDD callback. More...
 
typedef struct wiced_bt_hidd_pwr_md wiced_bt_hidd_pm_pwr_md_t
 

Enumerations

enum  wiced_bt_hidd_status_e {
  WICED_BT_HIDD_SUCCESS, WICED_BT_HIDD_ERR_NOT_REGISTERED, WICED_BT_HIDD_ERR_ALREADY_REGISTERED, WICED_BT_HIDD_ERR_NO_RESOURCES,
  WICED_BT_HIDD_ERR_NO_CONNECTION, WICED_BT_HIDD_ERR_INVALID_PARAM, WICED_BT_HIDD_ERR_UNSUPPORTED, WICED_BT_HIDD_ERR_UNKNOWN_COMMAND,
  WICED_BT_HIDD_ERR_CONGESTED, WICED_BT_HIDD_ERR_CONN_IN_PROCESS, WICED_BT_HIDD_ERR_ALREADY_CONN, WICED_BT_HIDD_ERR_DISCONNECTING,
  WICED_BT_HIDD_ERR_SET_CONNECTABLE_FAIL, WICED_BT_HIDD_ERR_HOST_UNKNOWN, WICED_BT_HIDD_ERR_L2CAP_FAILED, WICED_BT_HIDD_ERR_AUTH_FAILED,
  WICED_BT_HIDD_ERR_SDP_BUSY, WICED_BT_HIDD_ERR_GATT, WICED_BT_HIDD_ERR_INVALID = 0xFF
}
 HID status codes. More...
 
enum  wiced_bt_hidd_cback_event_e {
  WICED_BT_HIDD_EVT_OPEN, WICED_BT_HIDD_EVT_CLOSE, WICED_BT_HIDD_EVT_RETRYING, WICED_BT_HIDD_EVT_MODE_CHG,
  WICED_BT_HIDD_EVT_PM_FAILED, WICED_BT_HIDD_EVT_CONTROL, WICED_BT_HIDD_EVT_GET_REPORT, WICED_BT_HIDD_EVT_SET_REPORT,
  WICED_BT_HIDD_EVT_GET_PROTO, WICED_BT_HIDD_EVT_SET_PROTO, WICED_BT_HIDD_EVT_GET_IDLE, WICED_BT_HIDD_EVT_SET_IDLE,
  WICED_BT_HIDD_EVT_DATA, WICED_BT_HIDD_EVT_DATC, WICED_BT_HIDD_EVT_L2CAP_CONGEST
}
 HID-Device Callback Events. More...
 
enum  wiced_bt_hidd_st_e { WICED_BT_HIDD_BUSY_CONN_ST, WICED_BT_HIDD_IDLE_CONN_ST, WICED_BT_HIDD_SUSP_CONN_ST }
 HIDD state (see wiced_bt_hidd_st_e) More...
 

Functions

wiced_bt_hidd_status_t wiced_bt_hidd_register (wiced_bt_hidd_reg_info_t *p_reg_info)
 Function wiced_bt_hidd_register. More...
 
wiced_bt_hidd_status_t wiced_bt_hidd_deregister (void)
 Function wiced_bt_hidd_deregister. More...
 
wiced_bt_hidd_status_t wiced_bt_hidd_connect (void)
 Function wiced_bt_hidd_connect. More...
 
wiced_bt_hidd_status_t wiced_bt_hidd_disconnect (void)
 Function wiced_bt_hidd_disconnect. More...
 
wiced_bt_hidd_status_t wiced_bt_hidd_hand_shake (uint8_t res_code)
 Function wiced_bt_hidd_hand_shake. More...
 
wiced_bt_hidd_status_t wiced_bt_hidd_virtual_unplug (void)
 Function wiced_bt_hidd_virtual_unplug. More...
 
wiced_bt_hidd_status_t wiced_bt_hidd_send_data (wiced_bool_t control_ch, uint8_t rep_type, uint8_t *p_data, uint16_t data_len)
 Function wiced_bt_hidd_send_data. More...
 

Detailed Description

Human Interface Device Profile (HID) Device over BR/EDR.

Macro Definition Documentation

#define HID_PAR_CONTROL_NOP   (0)

Parameters for Control.

No Operation

#define HID_PAR_HANDSHAKE_RSP_ERR_INVALID_PARAM   (4)

Parameter value is out of range or inappropriate for the request.

#define HID_PAR_HANDSHAKE_RSP_SUCCESS   (0)

Parameters for Handshake.

Handshake successful

#define HID_PAR_PROTOCOL_MASK   (0x01)

Parameters for Protocol Type.

Mask used for report type

#define HID_PAR_REP_TYPE_MASK   (0x03)

Different report types in get, set, data.

Mask used for report type

#define HID_SDP_DESCRIPTOR_REPORT   (0x22)

Descriptor types in the SDP record (see Table 5.6: Descriptor Type Codes)

Descriptor type report

Typedef Documentation

typedef void( wiced_bt_hidd_callback_t)(wiced_bt_hidd_cback_event_t event, uint32_t data, wiced_bt_hidd_event_data_t *p_event_data)

HIDD callback.

Callback for Human Interface Device Profile Device (HIDD)

Parameters
[in]event: Callback event (see #
[in]data: Integer data corresponding to the event
[in]p_data: Data associated with the event
Returns
void

HID-Device Response data.

HIDD get report data

Enumeration Type Documentation

HID-Device Callback Events.

Enumerator
WICED_BT_HIDD_EVT_OPEN 

Connected to host with Interrupt and Control Data = 1 if Virtual Cable Channels in OPEN state.

pdata = Host BD-Addr.

WICED_BT_HIDD_EVT_CLOSE 

Connection with host is closed.

Data=Reason Code.

WICED_BT_HIDD_EVT_RETRYING 

Lost connection is being re-connected.

Data=Retrial number

WICED_BT_HIDD_EVT_MODE_CHG 

Device changed power mode.

Data=new power mode

WICED_BT_HIDD_EVT_PM_FAILED 

Device power mode change failed.

WICED_BT_HIDD_EVT_CONTROL 

Host sent HID_CONTROL Data=Control Operation.

WICED_BT_HIDD_EVT_GET_REPORT 

Host sent GET_REPORT Data=Length pdata=structure having details of get-report.

WICED_BT_HIDD_EVT_SET_REPORT 

Host sent SET_REPORT Data=Length pdata=details.

WICED_BT_HIDD_EVT_GET_PROTO 

Host sent GET_PROTOCOL Data=NA.

WICED_BT_HIDD_EVT_SET_PROTO 

Host sent SET_PROTOCOL Data=1 for Report, 0 for Boot.

WICED_BT_HIDD_EVT_GET_IDLE 

Host sent GET_IDLE Data=NA.

WICED_BT_HIDD_EVT_SET_IDLE 

Host sent SET_IDLE Data=Idle Rate.

WICED_BT_HIDD_EVT_L2CAP_CONGEST 

L2CAP channel congested.

HIDD state (see wiced_bt_hidd_st_e)

Enumerator
WICED_BT_HIDD_BUSY_CONN_ST 

Busy state.

WICED_BT_HIDD_IDLE_CONN_ST 

Idle state.

WICED_BT_HIDD_SUSP_CONN_ST 

Suspension state.

HID status codes.

Enumerator
WICED_BT_HIDD_SUCCESS 

Success.

WICED_BT_HIDD_ERR_NOT_REGISTERED 

Not registered.

WICED_BT_HIDD_ERR_ALREADY_REGISTERED 

Alreadu registered.

WICED_BT_HIDD_ERR_NO_RESOURCES 

No resources.

WICED_BT_HIDD_ERR_NO_CONNECTION 

Not connection.

WICED_BT_HIDD_ERR_INVALID_PARAM 

Invalid parameter.

WICED_BT_HIDD_ERR_UNSUPPORTED 

Not supported.

WICED_BT_HIDD_ERR_UNKNOWN_COMMAND 

Unknown command.

WICED_BT_HIDD_ERR_CONGESTED 

Congested.

WICED_BT_HIDD_ERR_CONN_IN_PROCESS 

Connection in process.

WICED_BT_HIDD_ERR_ALREADY_CONN 

Already connected.

WICED_BT_HIDD_ERR_DISCONNECTING 

Disconnecting is process.

WICED_BT_HIDD_ERR_SET_CONNECTABLE_FAIL 

Set connectable failiure.

WICED_BT_HIDD_ERR_HOST_UNKNOWN 

Host unknown.

WICED_BT_HIDD_ERR_L2CAP_FAILED 

L2CAP failed.

WICED_BT_HIDD_ERR_AUTH_FAILED 

Authentication failed.

WICED_BT_HIDD_ERR_SDP_BUSY 

SDP busy.

WICED_BT_HIDD_ERR_GATT 

GATT.

WICED_BT_HIDD_ERR_INVALID 

Invalid.