欢迎来到天天文库
浏览记录
ID:49659561
大小:409.00 KB
页数:5页
时间:2020-03-03
《蓝牙HID协议笔记.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、蓝牙HID协议笔记(2013-07-3115:05:53)转载▼标签:分类:Bluetooth1.概述TheHumanInterfaceDevice(HID)定义了蓝牙在人机接口设备中的协议、特征和使用规程。典型的应用包括蓝牙鼠标、蓝牙键盘、蓝牙游戏手柄等。该协议改编自USBHIDProtocol。2.一些概念(1)HIDReports:BluetoothHIDdevices支持三种Report:Input,Output,andFeature。(2)HID建立ControlChannel和InterruptChannel两个通道,r
2、eport可以在这两条channel上传输,在Controlchannel上传输的report称为synchronousreports;在Interruptchannel上传输的report称为asynchronousreports。(3)FeaturereportsarealwaystransferredsynchronouslyusingGET_REPORTorSET_REPORTrequests。(4)ReportProtocolMode和BootProtocolMode。BluetoothHIDHosts至少支持一种,Blu
3、etoothHIDDevice则需要支持ReportProtocolMode,并且ReportProtocolMode是BluetoothHIDDevice的默认Mode。3.BluetoothHIDProtocolMessages这些message不能超过L2CAP的MTU,大小超过MTU的message将被忽略。MessageHeader的格式如下:(1)HANDSHAKE该Message用来acknowledgeSET_REPORT,SET_IDLEandSET_PROTOCOL等request。只在ControlChanne
4、l上传输,只由BluetoothHIDdevice。Parameter部分定义如下:(2)HID_CONTROL控制BluetoothHIDdevice改变状态。Parameter部分定义如下:(3)GET_REPORTBluetoothHIDHost用来请求BluetoothHIDdevice的传输。定义如下:(4)SET_REPORTBluetoothHIDHost用来向BluetoothHIDdevice发起传输。格式如下:(5)GET_PROTOCOL用来获取BluetoothHIDdevice的ProtocolMode,然
5、后BluetoothHIDdeviceresponse一个DATApayload说明当前的ProtocolMode。格式如下:GET_PROTOCOLDataDefinition格式如下:(6)SET_PROTOCOL用来设置BluetoothHIDdevice的BluetoothHIDdevice。格式如下:(7)DATA代表一个aHIDpayload。格式如下:4.Transfers以HIDProtocolmessages的形式传输。(1)ControlChannelTransfers分为Acknowledged和Unackno
6、wledged两种,格式如下:(2)InterruptChannelTransfersInterruptIN和InterruptOUT两种,可以在任意时刻发送。【中断嘛】5.其余各层对于HID的要求HID与L2CAP的交互如下:
此文档下载收益归作者所有