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 标值。
俗话说:有人的处所就有江湖。小明说:有江湖的处所就有竞争。想想也是,企业与企业之间有竞争,路边的小贩与小贩之间也有竞争,连坐个公交车都有竞争。其实有竞争从某种意义上说照旧好的,一些人竞争是但愿通过自身...
找黑客改彩票注单相关问题 怎么做一名合格的黑客相关问题 成为黑客需要什么 黑客到底可以厉害到什么程度(可以假装黑客的网站)...
电脑上维持在桌面上,鼠标右键点一下桌面上空白,点一下显示设置,进行变更文字、运用等新项目的尺寸,挑选小占比,能够变小字体样式,挑选大占比,能够调字体大小,自主挑选适合的占比就可以。 知名品牌型号规格:...
SEO向来不是一项简略的作业,在排名的背面是许多汗水的支付,关于流量计算东西中的跳出率,作为一名网站搜索引擎优化er,你又有几了解呢?网站的跳出率,直接关系到了搜索引擎给予的网站排名成果。 百度计算...
好莱坞知名喜剧男星杰克·布莱克现已加入《无主之地》真人电影,为小吵闹配音。 此前杰克布莱克曾为《功夫熊猫》系列熊猫阿宝配音,最近参演了《勇敢者游戏2》、《鸡皮疙瘩2》等电影。...
加盟者想要在加盟的路上走得越发的顺利,独一的要领就是找对一个加盟品牌,这个加盟品牌首先必需要切合列位加盟者的加盟条件,不会为加盟投资者带来任何的加盟承担,其次就是要有精采的成长前景,好利来加盟品牌就是...