蓝牙HID协议介绍1 概述 nbsp nbsp nbsp nbsp TheHumanInte HID 定义了蓝牙在人机接口设备中的协议 特征和使用规程 典型的应用包括蓝牙鼠标 蓝牙键盘 蓝牙游戏手柄等 该协议改编自 USBHIDProtoc nbsp nbsp nbsp nbsp 2 一些概念 1 HIDReports BluetoothHID 支持三种 Report Input Output
1.概述
The Human Interface Device (HID)定义了蓝牙在人机接口设备中的协议、特征和使用规程。典型的应用包括蓝牙鼠标、蓝牙键盘、蓝牙游戏手柄等。该协议改编自USB HID Protocol。
2.一些概念
(1)HID Reports:Bluetooth HID devices支持三种Report:Input, Output, and Feature。
(2)HID建立Control Channel和Interrupt Channel两个通道,report可以在这两条channel上传输,在Control channel上传输的report称为synchronous reports ;在Interrupt channel上传输的report称为asynchronous reports。
(3)Feature reports are always transferred synchronously using GET_REPORT or SET_REPORT requests。
(4)Report Protocol Mode和Boot Protocol Mode。Bluetooth HID Hosts至少支持一种,Bluetooth HID Device则需要支持Report Protocol Mode,并且Report Protocol Mode是Bluetooth HID Device的默认Mode。
3.Bluetooth HID Protocol Messages
这些message不能超过L2CAP的MTU,大小超过MTU的message将被忽略。
Message Header的格式如下:
该Message用来acknowledgeSET_REPORT, SET_IDLE and SET_PROTOCOL等request。只在Control Channel上传输,只由Bluetooth HID device。
Parameter部分定义如下:
(2)HID_CONTROL
控制Bluetooth HID device改变状态。
Parameter部分定义如下:
(3)GET_REPORT
Bluetooth HID Host用来请求Bluetooth HID device的传输。
定义如下:
(4)SET_REPORT
Bluetooth HID Host用来向Bluetooth HID device发起传输。
格式如下:
(5)GET_PROTOCOL
用来获取Bluetooth HID device的Protocol Mode,然后Bluetooth HID device response一个DATA payload说明当前的Protocol Mode。
格式如下:

GET_PROTOCOL Data Definition格式如下: (6)SET_PROTOCOL
用来设置Bluetooth HID device的Bluetooth HID device。格式如下:
(7)DATA
代表一个a HID payload。格式如下:
4.Transfers
以HID Protocol messages的形式传输。
(1)Control Channel Transfers
分为Acknowledged和Unacknowledged两种,格式如下:

(2)Interrupt Channel Transfers
Interrupt IN和Interrupt OUT两种,可以在任意时刻发送。【中断嘛】
5.其余各层对于HID的要求
HID与L2CAP的交互如下:
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/230084.html原文链接:https://javaforall.net