Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hid_device.h File Reference

HID Device Protocol handling. More...

#include <stdbool.h>
#include <stdint.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/net_buf.h>

Go to the source code of this file.

Data Structures

struct  bt_hid_device_cb
 Callbacks supplied by the HID application. More...

Macros

HID protocol mode values

These values indicate which HID protocol the host requests the device to use.

BOOT_MODE is the legacy boot protocol; REPORT_MODE indicates normal report protocol operation.

#define BT_HID_PROTOCOL_BOOT_MODE   0x00
 Boot protocol mode (legacy).
#define BT_HID_PROTOCOL_REPORT_MODE   0x01
 Report protocol mode (default).
HID report types used for Get/Set/Data operations

These map to report type fields in HID messages.

INPUT reports are typically device->host, OUTPUT are host->device, and FEATURE are device-specific feature reports.

#define BT_HID_REPORT_TYPE_INPUT   0x01
 Report type for input reports (1) - device->host.
#define BT_HID_REPORT_TYPE_OUTPUT   0x02
 Report type for output reports (2) - host->device.
#define BT_HID_REPORT_TYPE_FEATURE   0x03
 Report type for feature reports (3) - device-specific.

Functions

int bt_hid_device_register (const struct bt_hid_device_cb *cb)
 Register HID device callbacks.
int bt_hid_device_unregister (void)
 Unregister HID device callbacks and disable HID services.
int bt_hid_device_connect (struct bt_conn *conn, struct bt_hid_device **hid)
 Initiate an outgoing HID association on the given connection.
int bt_hid_device_disconnect (struct bt_hid_device *hid)
 Disconnect a previously connected HID association.
struct net_bufbt_hid_device_create_pdu (struct net_buf_pool *pool)
 Allocate/create a PDU buffer suitable for HID over L2CAP.
int bt_hid_device_input_report (struct bt_hid_device *hid, struct net_buf *buf)
 Send a HID interrupt input report to the HID host.
int bt_hid_device_virtual_cable_unplug (struct bt_hid_device *hid)
 Trigger a virtual cable unplug procedure for the given HID association.
struct bt_connbt_hid_device_get_conn (struct bt_hid_device *hid)
 Obtain the ACL connection associated with a HID device.

Detailed Description

HID Device Protocol handling.