Class of device,通称 CoD,用以叙述一个 BR/EDR 设备的种类。
当地设备进行 inquiry (HCI_Inquiry command) 后,远侧处在 inquiry scan 情况的设备会回应一些基础数据信息。这种数据信息被 controller 封裝在 event 中回到给 host。CoD 则是这种 event 中的一个主要参数。这时包括很有可能 CoD 的 event 以下:
HCI_Inquiry_Result event
HCI_Inquiry_Result_with_RSSI event
HCI_Extended_Inquiry_Result event
此外当当地设备接到远侧设备的联接要求时,将接到 HCI_Connection_Request event。该 event 也会带上 CoD。
分析 CoD 构造
CoD 的格式是可变性的,实际的格式由 Format Type 字段特定。在其中最普遍的格式是 “format #1”,且别的格式极为少见。这时 CoD 是一个尺寸为 3 bytes 的标值,它的构造如下图所显示(1st byte 为更大字节数):
下边将各自表述构成 CoD 的 3 个关键字段 Service Class, Major Device Class 与 Minor Device Class。
Service Class
下边为 0 的位被保存应用
Flag
Description
Example
1... .... 00.
Information
WEB-server, WAP-server
.1.. .... 00.
Telephony
Cordless telephony, Modem, Headset service
..1. .... 00.
Audio
Speaker, Microphone, Headset service
...1 .... 00.
Object Transfer
v-Inbox, v-Folder
.... 1... 00.
Capturing
Scanner, Microphone
.... .1.. 00.
Rendering
Printing, Speaker
.... ..1. 00.
Networking
LAN, Ad hoc
.... ...1 00.
Positioning
Location identification
.... .... 001
Limited Discoverable Mode
Major Device Class
Value
Description
Example
0b00000
Miscellaneous
0b00001
Computer
Desktop, Notebook, PDA, Organizers
0b00010
Phone
Cellular, Cordless, Payphone, Modem
0b00011
LAN /Network Access point
0b00100
Audio/Video
Headset, Speaker, Stereo, Video display, VCR
0b00101
Peripheral (HID)
Mouse, Joystick, Keyboards
0b00110
Imaging
Printing, Scanner, Camera, Display
0b00111
Wearable
0b01000
Toy
0b01001
Health
0b11111
Uncategorized
Others
Reserved
Minor Device Class
该字段尽管仅占有 8 bits,可是当 major device class 不另外,每一个 bit 的含意也不一样。因而该字段的界定很复杂,没有这儿过多阐释。实际能够参照 ref[1]。
一个分析 CoD 的事例
当 CoD 为 0x002540 时有:
0… …. …. …. …. ….=Service Classes: Information: False
.0.. …. …. …. …. ….=Service Classes: Telephony: False
..0. …. …. …. …. ….=Service Classes: Audio: False
…0 …. …. …. …. ….=Service Classes: Object Transfer: False
…. 0… …. …. …. ….=Service Classes: Capturing: False
…. .0.. …. …. …. ….=Service Classes: Rendering: False
…. ..0. …. …. …. ….=Service Classes: Networking: False
…. …0 …. …. …. ….=Service Classes: Positioning: False
…. …. 00.. …. …. ….=Service Classes: Reserved: 0x0
…. …. ..1. …. …. ….=Service Classes: Limited Discoverable Mode: True
…. …. …0 0101 …. ….=Major Device Class: Peripheral (HID) (0x05)
…. …. …. …. 01.. ….=Minor Device Class: Keyboard (0x1)
…. …. …. …. ..00 00..=Minor Device Class: Uncategorized device (0x0)
…. …. …. …. …. ..00=Format Type: 0x0
CoD 的掩藏
CoD 并并不是写死在 controller 中的数据信息,事实上它被 host 管理 *** 。Host 能够应用 HCI_Write_Class_of_Device command 改动当地设备的种类,进而做到掩藏的目地。应用以下指令能够载入或改动当地 BR/EDR 设备的种类:
hciconfig hci0 class
# hci0: Type: Primary Bus: USB
# BD Address: 11:22:33:44:55:19 ACL MTU: 310:10 SCO MTU: 64:8
# Class: 0x0c0000
# Service Classes: Rendering, Capturing
# Device Class: Miscellaneous,
sudo hciconfig hci0 class 0x002540
hciconfig hci0 class
# hci0: Type: Primary Bus: USB
# BD Address: 11:22:33:44:55:19 ACL MTU: 310:10 SCO MTU: 64:8
# Class: 0x002540
# Service Classes: Unspecified
# Device Class: Peripheral, Keyboard
此外 ref[2]是一个线上的 CoD *** 器,能够协助大家依据选中的设备种类自动生成 CoD 标值。
视频号,是否有未来呢?而微信是否能够做好视频号,假想的“风口”又是否存在呢? 这两天除了疫情,朋友圈里最火的要数“视频号”。 “我开通了视频号,快来关注一下吧。” “错过了抖音、快手,怎么能错过视频...
最近QQ号老被盗,都是被手机登录的,怎么被盗的? 1、QQ号最好要绑定密保手机号,在密码的设置上也需要用心,要用较为复杂的密码,并且要定期修改密码。更不能用QQ账号进行交易,这些行为都是违规的。2、通...
WinXP系统电脑内存的问题有哪些?雨林木风WinXP系统电脑内存关系着电脑的运行情况,那么,我们在使用电脑时经常会遇到的内存问题有哪些呢?请跟随小编一起看看以下的具体内容吧。 1、无法...
文章转载自:香港地产资讯网 百利保执行董事兼首席营运官范统再重申高成数按揭为糖衣毒药,富豪·悦庭总计36个单位中,5个高成数按揭名额亦只用了3个。但近日见市场高成数付款方式淡化,金管局亦开始关注相关...
本文导读目录: 1、6217开头是什么银行? 2、6217开头是什么银? 3、开头6217是工商银行的卡号 4、银行卡以6217开头的是哪个银行卡 5、6217开头是什么银行 621...
微信被盗,确凿使人丧气!微信有这么多身边的人的接洽方法,另有这么多紧张的片面和客户信息!因此,不要比及微灯号被盗,而后再想想你为何把号码弄丢了。 盗取微信号可以通过什么方式 1.绝不浮夸地说,险些...