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 标值。
本文目录一览: 1、《黑客》txt全集下载 2、超级黑客txt全集下载 3、《黑客》txt下载在线阅读,求百度网盘云资源 4、黑客— 幻世恩仇小说txt全集免费下载 5、最强黑客小说t...
相信现在有很多的朋友们对于以前个人贷款买过一套房,现在想跟老婆联名买一套房,能贷款几成能不能2人都用公积金贷款都想要了解吧,那么今天小编就来给大家针对以前个人贷款买过一套房,现在想跟老婆联名买一套房,...
《西游记》作为中国古代第一部浪漫主义长篇神话小说,可以说在中国家喻户晓、老少皆宜,耳熟能详。其中师徒四人齐心协力与各种妖怪斗智斗勇,历尽千难万险取得真经、修成正果的故事。 在惊险刺激、妙趣横生...
又是一年毕业季节,数据信息表明,2019年全国各地大学毕业生预估做到834万,将再创佳绩。2020年毕业季节,为考虑众多大学毕业生的入校寄包裹要求,京东快递初次在全国各地校园内京东派发布“大学毕业寄”...
时间过得真快,转眼2020年十月就快结束了,马上我们就将迎来十一月,2020年也只有两个月就要结束了,大家都希望在2020年的最后两个月里能做出一些成绩出来,很多人在十一月的第一天都会发说说,那么接下...
这三个标示出現在手机上。网络黑客将会会抓捕你。网民:大家应该怎么办?大家都知道,在网络时代,大家的确必须更为高度重视网络信息安全。假如私人信息和隐私泄...