蓝牙基础知识
- 格式:ppt
- 大小:1.27 MB
- 文档页数:26
蓝牙基础:蓝牙的工作原理1、什么是蓝牙?蓝牙(BlueTooth)是一种支持设备短距离通信的无线电技术,功率级别分CLASS1 100米距离和CLASS2 10米距离两种。
能在包括移动电话、PDA、无线耳机、笔记本电脑、相关外设等众多设备之间进行无线信息交换。
蓝牙的标准是IEEE802.15,工作在2.4GHz 频带,带宽可达3Mb/s。
手机、PDA、GPS蓝牙、耳机、笔记本内置蓝牙等一般为CLASS2 10米功率级别,工业用蓝牙应用100米级的多一些,如GC-06,KC-03蓝牙模块。
蓝牙技术规范由SIG组织开发维护,目前具备蓝牙通讯功能的产品已经很多。
2、蓝牙通信的主从关系蓝牙技术规定每一对设备之间进行蓝牙通讯时,必须一个为主角色,另一为从角色,才能进行通信,通信时,必须由主端进行查找,发起配对,建链成功后,双方即可收发数据。
理论上,一个蓝牙主端设备,可同时与7个蓝牙从端设备进行通讯。
一个具备蓝牙通讯功能的设备,可以在两个角色间切换,平时工作在从模式,等待其它主设备来连接,需要时,转换为主模式,向其它设备发起呼叫。
一个蓝牙设备以主模式发起呼叫时,需要知道对方的蓝牙地址,配对密码等信息,配对完成后,可直接发起呼叫。
3、蓝牙的呼叫过程蓝牙主端设备发起呼叫,首先是查找,找出周围处于可被查找的蓝牙设备,此时从端设备需要处于可被查找状态,如:蓝牙耳机需要按键操作才能进入可被查找状态,我公司预装GCM-301、101等固件的模块始终处于可被查找状态。
主端设备找到从端蓝牙设备后,与从端蓝牙设备进行配对,此时需要输入从端设备的PIN码,一般蓝牙耳机默认为:1234或0000,立体声蓝牙耳机默认为:8888,也有设备不需要输入PIN码。
配对完成后,从端蓝牙设备会记录主端设备的信任信息,此时主端即可向从端设备发起呼叫,根据应用不同,可能是ACL数据链路呼叫或SCO语音链路呼叫,已配对的设备在下次呼叫时,不再需要重新配对。
蓝牙的基础知识嘿,咱来说说蓝牙的基础知识哈。
有一回啊,我想买个无线耳机,就去商场里逛。
售货员给我推荐了好几款,都说有蓝牙功能。
我这时候就懵了,啥是蓝牙啊?售货员就给我解释了一通,我这才有点明白。
蓝牙呢,简单来说就是一种能让不同设备之间无线连接的技术。
比如说,你的手机和无线耳机之间,不用插线,就能通过蓝牙连接起来,可方便了。
我记得有一次,我在路上看到一个人戴着无线耳机,一边走一边听音乐,可自在了。
我就想,这蓝牙技术可真厉害。
蓝牙的连接范围一般不是特别远。
大概也就几米到十几米吧。
要是离得太远了,信号就不好了。
我有一次在家里,手机放在客厅,我拿着无线耳机去了卧室,就有点断断续续的。
我还以为耳机坏了呢,后来才发现是离得太远了。
蓝牙连接也挺简单的。
一般就是打开设备的蓝牙功能,然后搜索附近的设备,找到要连接的那个,点一下就可以了。
我买了无线耳机回家后,按照说明书上的步骤,很快就和手机连接上了。
那感觉,就像找到了一个新伙伴。
而且啊,现在很多设备都有蓝牙功能呢。
除了无线耳机,还有蓝牙音箱、蓝牙鼠标、蓝牙键盘啥的。
我有个朋友就有一个蓝牙音箱,小小的,但是声音可大了。
我们一起出去玩的时候,他就把蓝牙音箱拿出来,连接上手机,放音乐听。
大家都觉得可好玩了。
蓝牙还有一个好处,就是比较省电。
不像有些无线技术,用一会儿就没电了。
我用我的无线耳机,充一次电可以用好几个小时呢。
这可省了不少事儿。
总之啊,蓝牙技术虽然看起来挺复杂,但是用起来还挺方便的。
以后要是再买设备,我肯定还会优先考虑有蓝牙功能的。
嘿嘿。
1什么是蓝牙技术所谓蓝牙技术,实际上是一种短距离无线电技术,利用"蓝牙技术"能够有效地简化掌上电脑、笔记本电脑和移动电话手机等移动通信终端设备,并且能够成功地简化以上这些设备与因特网之间的通信,从而使这些现代通信设备与因特网之间的数据传输变得更加迅速高效,为无线通信拓宽道路。
通俗地讲,蓝牙技术使得现代一些轻易携带的移动通信设备和电脑设备,不必借助电缆就能联网,并且能够实现无线上因特网。
其实际应用范围还可以拓展到各种家电产品、消费电子产品和汽车等信息家电,组成一个巨大的无线通信网络。
2蓝牙技术的特点2.1蓝牙协议体系结构整个蓝牙协议体系结构可分为底层硬件模块、中间协议层和高端应用层三大部分。
链路管理层(L M P)、基带层(B B P)和蓝牙无线电信道构成蓝牙的底层模块。
B B P层负责跳频和蓝牙数据及信息帧的传输。
L M P层负责连接的建立和拆除以及链路的安全和控制,它们为上层软件模块提供了不同的访问人口,但是两个模块接口之间的消息和数据传递必须通过蓝牙主机控制器接口的解释才能进行。
也就是说,中间协议层包括逻辑链路控制与适配协议(L2C A P)、服务发现协议(S D P)、串口仿真协议(R F C O M M)和电话控制协议规范(T C S)。
L2C A P完成数据拆装、服务质量控制、协议复用和组提取等功能,是其他上层协议实现的基础,因此也是蓝牙协议栈的核心部分。
S D P为上层应用程序提供一种机制来发现网络中可用的服务及其特性。
在蓝牙协议栈的最上部是高端应用层,它对应于各种应用模型的剖面,是剖面的一部分。
目前定义了13种剖面。
2.2蓝牙低层模块蓝牙的低层模块是蓝牙技术的核心,是任何蓝牙设备都必须包括的部分。
蓝牙工作在2.4G H Z的I S M频段。
采用了蓝牙结束的设备讲能够提供高达720k b i t/s的数据交换速率。
蓝牙支持电路交换和分组交换两种技术,分别定义了两种链路类型,即面向连接的同步链路(S C O)和面向无连接的异步链路(A C L)。
•flash和rom的区别:flash和rom版本的蓝牙芯片,最大的区别就是flash版本蓝牙芯片可以加入客户代码,而rom版本则不行。
rom版本芯片(例如CSR8635、8640、8645,CSRA64系列、还有创杰、中星微的大部分芯片)只能修改一些配置参数,例如按键操作、led灯的闪烁方式、语音提示等一些简单的配置,使用rom版本芯片做的产品差异化较少,但是开发简单,对于一些常规产品,不需要深度客制化的产品,选用rom版芯片可加快开发进度,加快产品上市时间。
而如果是做一些需要深度客户自定义的产品,例如需要增加一些传感器,或与外部MCU进行通信,或需要增加蓝牙协议(或服务),则需要使用flash版本(如CSR8670、8675、QCC300x系列、洛达、炬力等芯片),客户可在flash芯片已有的工程上添加自己的功能代码,可做差异化产品。
•经典蓝牙和低功耗蓝牙的区别:经典蓝牙就是我们经常说的BR/EDR,或2.0+EDR,3.0+HS 等,总的来说,在蓝牙4.0以前的蓝牙版本都属于经典蓝牙,当然,蓝牙协议是向下兼容的,蓝牙4.0、4.1、4.2及最新的蓝牙5都包含了经典蓝牙部分,从蓝牙4.0开始,可以理解为是在经典蓝牙协议的基础上增加了低功耗蓝牙协议(我们常说的BLE)。
经典蓝牙和低功耗蓝牙是针对不同的应用领域提出的,经典蓝牙主要应用于音频和大数据容量传输,音频方面有A2DP(音频分发协议)和HFP(免提协议)/HSP(耳机协议)用于传输音乐音频和通话音频,在数据传输方面有SPP(蓝牙串口协议)、OPP(对象交换协议,用于传输文件)、CBAP (电话本协议)等,在数传这块还有HID(人机接口协议),用于支持蓝牙鼠标、蓝牙键盘这些与主机进行交互的外围设备。
低功耗蓝牙也是用于数据传输,但是主要应用于数据容量小,实时性较高的应用,在实际运用中,通常会搭载各种传感器,例如检测心率、血压、血糖、体重等;用户也可以根据实际需要,自定义自己的 BLE服务。
⼩⽩学习蓝⽛第⼀章——蓝⽛概述⽬录蓝⽛的概念蓝⽛,是⼀种⽀持设备短距离通信(⼀般10m内)的⽆线电技术,能在包括移动电话、PDA、⽆线⽿机、笔记本电脑、相关外设等众多设备之间进⾏⽆线信息交换。
利⽤“蓝⽛”技术,能够有效地简化移动通信终端设备之间的通信,也能够成功地简化设备与因特⽹Internet之间的通信,从⽽数据传输变得更加迅速⾼效,为⽆线通信拓宽道路。
蓝⽛作为⼀种⼩范围⽆线连接技术,能在设备间实现⽅便快捷、灵活安全、低成本、低功耗的数据通信和语⾳通信,因此它是⽬前实现⽆线个域⽹通信的主流技术之⼀。
与其他⽹络相连接可以带来更⼴泛的应⽤。
是⼀种尖端的开放式⽆线通信,能够让各种数码设备⽆线沟通,是⽆线⽹络传输技术的⼀种,原本⽤来取代红外。
蓝⽛技术是⼀种⽆线数据与语⾳通信的开放性全球规范,它以低成本的近距离⽆线连接为基础,为固定与移动设备通信环境建⽴⼀个特别连接。
其实质内容是为固定设备或移动设备之间的通信环境建⽴通⽤的⽆线电空中接⼝(Radio Air Interface),将通信技术与计算机技术进⼀步结合起来,使各种3C设备在没有电线或电缆相互连接的情况下,能在近距离范围内实现相互通信或操作。
简单的说,蓝⽛技术是⼀种利⽤低功率⽆线电在各种3C设备间彼此传输数据的技术。
蓝⽛⼯作在全球通⽤的2.4GHz ISM(即⼯业、科学、医学)频段,使⽤IEEE802.11协议。
作为⼀种新兴的短距离⽆线通信技术,正有⼒地推动着低速率⽆线个⼈区域⽹络的发展。
蓝⽛的产背景1998 年 5 ⽉,爱⽴信、诺基亚、东芝、 IBM和英特尔公司等五家著名⼚商,在联合开展短程⽆线通信技术的标准化活动时提出了蓝⽛技术,其宗旨是提供⼀种短距离、低成本的⽆线传输应⽤技术。
这五家⼚商还成⽴了蓝⽛特别兴趣组,以使蓝⽛技术能够成为未来的⽆线通信标准。
芯⽚霸主 Intel 公司负责半导体芯⽚和传输软件的开发,爱⽴信负责⽆线射频和移动电话软件的开发, IBM 和东芝负责笔记本电脑接⼝规格的开发。
蓝牙基础必学知识点
1. 蓝牙是一种无线通信技术,可通过短距离无线信号传输数据。
2. 蓝牙可以连接多个设备,并使它们之间实现数据传输和通信。
3. 蓝牙技术使用2.4 GHz的ISM频段进行通信,运行距离通常为10米。
4. 蓝牙设备通常分为主设备和从设备。
主设备用于发起连接和控制连接,从设备用于接受连接和传输数据。
5. 蓝牙设备通过建立蓝牙连接来进行通信,连接可以是单向的或双向的。
6. 蓝牙使用蓝牙协议栈来处理通信过程,包括物理层、链路层、网络
层和应用层。
7. 蓝牙可以支持多种数据传输模式,包括串口通信、音频传输、文件
传输等。
8. 蓝牙设备可以通过扫描和配对来建立连接,配对可以使用PIN码或
简化的配对码。
9. 蓝牙设备可以通过蓝牙配置文件进行兼容性管理,不同的配置文件
适用于不同的应用场景。
10. 蓝牙技术广泛应用于各种设备,包括手机、耳机、扬声器、键盘、鼠标、汽车、家电等。
蓝牙协议知识总结蓝牙设备和主机进行连接和数据通信的流程如下:1 外部设备发出广告(带有UUID信息等其他信息);2 主机(集中器设备)收到广告信息,进而发送扫描请求;表示我扫描到你的信息;3 外部设备收到扫描请求后,返回扫描回应,表示我知道你扫描到我的信息;4 主机进而发送连接请求信息,表示主机要跟设备建立无线连接;5 设备收到连接请求后,发送相应请求回应;表示已经建立连接;数据读写流程如下进一步(在建立连接的基础上):6 主机发送主服务UUID(设备的广告UUID)给设备;服务发现7 设备收到后回应服务信息;8 主机发送特性UUID;特性发现9 设备收到后回应特性值句柄;(类似于存储设备的地址)10 主机发送特性值句柄;读信息11 设备收到后回应特性值;12 主机发送特性值句柄和要写入值;写信息13 设备回应写入成功响应;在睡眠状态,耗电只有1微安(uA),而在连接事件中最高的是10几个毫安连接建立之后,再进行安全密钥的交换配对,进而进行数据的读写;主机和从机绑定之后,断开连接后,可以快速的建立连接并进行加密读写,而不需要再次配对;特点1 低功耗蓝牙速度只有100bps ,传统蓝牙有3Mbps2 低功耗蓝牙不需要IOS 的MFI 认证,传统蓝牙必须;3 低功耗蓝牙能纽扣电池能用1年多,传统蓝牙不行;频道:2.4G – 2.48G 总共40个频段,每2M 一个频段;其中37(2.40G),38(2.426G),39(2.48G)为3个广播频道;这3个频道避开了wifi 常用的频道,与wifi可以共存;其他37个为连接频道;1、BLE中主从机建立连接,到配对和绑定的过程如下图。
正如上图所示,最简单一次蓝牙通信需要以上相关步骤,包括discoverydevice,connect,pairing,bond等4个主要部分。
1)广播:广播包可以包含广播数据,广播包可以无指定或者对指定的设备发送。
可以声明该器件是可连接的还是不可连接的。
Bluetooth协议一、射频及基带部分Bluetooth设备工作在2.4GHz的ISM(Industrial,Science and Medicine)频段,在北美和欧洲为2400~2483.5MHz,使用79个频道,载频为2402+kMHz(k=0,1…,22)。
无论是79个频道还是23个频道,频道间隔均为1MHz,采用时分双工(TDD,TimeDivision Duplex)方式。
调制方式为BT=0.5的GFSK,调制指数为0.28~0.35,最大发射功率分为三个等级,分别是:100mW(20dBm),2.5mW (4dBm)和1mW(0dBm),在4~20dBm范围内要求采用功率控制,因此,Bluetooth 设备间的有效通信距离大约为10~100米。
Bluetooth的基带符号速率为1Mb/s,采用数据包的形式按时隙传送,每时隙长0.625ūs,不排除将来采用更高的符号速率。
Bluetooth系统支持实时的同步面向连接传输和非实时的异步面向非连接传输,分别成为SCO链路(Synchronous Ccnnection-Oriented Link)和ACL链路(Asynchronous Connection-Less Link),前者只要传送语音等实时性强的信息,在规定的时隙传输,后者则以数据为主,可在任意时隙传输。
但当ACL传输占用SCO的预留时隙,一旦系统需要SCO传输,ACL则自动让出这些时隙以保证SCO的实时性。
数据包被分成3大类:链路控制包、SCO包和ACL包。
已定义了4钟链路控制数据包,后两者最多可分别定义12种,目前已定义了4种和7种,即共定义了15种。
大多数数据包只占用1个时隙,但有些包占用3个或5个时隙。
Bluetooth支持64kb/s的实时语音传输和各种速率的数据传输,语音编码采用对数PCM或连续可变斜率增量调制(CVSD,Continuous Variable Slope Delta Modulation)。
蓝牙技术基础知识六问六答Q1:蓝牙的网络结构是怎么样的?蓝牙是一个点对点或者点对多点的拓扑结构,他们的交互都是基于一个物理通道(Physical Channel)上的。
也就是说点对点之间有一条物理通道,点对多点共享一条物理通道。
我们把这些共用一个物理通道的集合称之为微微网(piconet)。
在一个微微网中只有一个设备能称之为Master,其余的设备都是Slave。
需要注意的是活跃的slave最多只能是7个,当然我们可以连接更多的slave,但是在同一时间,除了7个活跃的slave外别的slave不能处于活跃的状态。
我们把他们称之为parked的slave,也就是说他们是在睡大觉。
若是piconet中活跃的设备不足7个,他们就可以随时醒来,而且不需要再进行任何connection建立的过程。
具体的可参见下图一,其中绿色的为Master,黑色的为Slave。
Q2:蓝牙的传输速率怎么样?蓝牙是在空气中进行传输的,他有两种传输模式:1、Basic Rate:它的传输速率是1Mbps。
2、Enhanced Data Rate:a)初级调制模式:2Mbps;b)二级调制模式:3Mbps。
Q3:蓝牙有内部时钟吗?答案是肯定的,蓝牙内部有native的clock。
和外部的真实时间是没有关系的。
它最低能表示的单元必须是312.5μs,就是半个slot。
也就是说时钟的频率需要是3.2kHz。
有四个周期在蓝牙中是很重要的,他们分别是312.5μs,625μs,1.25ms以及1.28s。
他们对应的就是我们俗称的CLK0,CLK1,CLK2和CLK12。
Q4:蓝牙能容忍的时钟偏差是多少啊?这是一个很好的问题。
在spec上规定,正常情况下native的clock的偏差允许范围是+/-20ppm,当然在一些底功耗的模式下,比如park,sniff,hold等模式下,这个偏差的范围有所扩大,可以到+/-250ppm。
Q5:蓝牙地址就是我们看到的那一堆随机数吗?Spec中对蓝牙地址的格式是有很严格的规定的。
iOS蓝⽛开发详解(基本知识、相关类图、交互流程)本⽂从以下三⽅⾯讲解下蓝⽛开发1、蓝⽛相关基本知识2、蓝⽛相关类图3、蓝⽛交互流程⼀、蓝⽛相关基本知识涉及到蓝⽛开发,⾸先有⼏个问题是需要我们理解的1、任何设备既可以是中⼼设备、也可以是外围设备2、外设和中⼼设备之间通过特征建⽴⼀个双向的数据通道3、CBCentralManager主要操作中⼼设备,处理链接上外设之前的操作,链接上外设后,主要靠CBPeripheral(主要操作外设)处理外设相关操作(服务、特征、数据读写)4、中⼼设备管理CBCentralManager中⼼控制类,主要管理中⼼设备,以及处理跟外设(外围设备)相关操作,主要是扫描、链接、断开外设。
操作中⼼设备的核⼼类。
很重要的协议CBCentralManagerDelegate,包含中⼼设备状态(是否打开蓝⽛)回调、发现外设回调、链接外设成功回调、链接外设失败回调、外设链接断开回调等⽅法。
⼀个中⼼设备可以链接多个外围设备。
5、外围设备 CBPeripheral外设类,包含设备的基础属性,名字,uuid等信息。
向外设写⼊数据。
当中⼼设备连接到外设后,需要通过外设对象的代理⽅法进⾏数据交互。
操作外围设备的核⼼类。
很重要的协议CBPeripheralDelegate,包含发现服务回调、发现特征回调、特征的通知设置改变回调、特征更新回调、特征已写⼊数据回调等⽅法。
⼀个设备包含多个服务、⼀个服务包含多个特征、⼀个特征⼜包含多个描述。
6、外围设备管理CBPeripheralManager设备的控制,主要可以为设备设置Service以及Characteristic,可以⼿动配置特定的服务和特征值,也可看作可以⾃定义蓝⽛协议,例如将⼿机作为外设时可以为⾃⼰的⼿机蓝⽛设置服务和特征值。
CBCentralManager更适合将⾃⼰的软件作为中⼼。
⽤的较少7、服务 CBService服务对象是⽤来管理外设提供的⼀些数据服务的。
蓝牙技术基础蓝牙的技术特点蓝牙技术是一种无线数据与语音通信的开放性标准,它以低成本的近距离无线连接为基础,为固定与移动设备通信环境建立一个特别连接。
如果把蓝牙技术引入到移动电话和便携型电脑中,就可以去掉移动电话与便携型电脑之间令人讨厌的连接电缆而通过无线使其建立通信。
打印机、PDA、桌上型电脑、传真机、键盘、游戏操纵杆及所有其它的数字设备都可以成为“蓝牙”技术系统的一部分。
除此之外,蓝牙无线技术还为已存在的数字网络和外设提供通用接口以组建一个远离固定网络的个人特别连接设备群。
蓝牙技术在全球通用的2.4GHz ISM(工业、科学、医学)频段,蓝牙的数据速率为1Mb/s。
从理论上来讲,以2.45GHz ISM波段运行的技术能够使相距30m以内的设备互相连接,传输速率可达到2Mbps,但实际上很难达到。
应用了蓝牙技术link and play的概念,有点类似“即插即用”的概念,任意蓝牙技术设备一旦搜寻到另一个蓝牙技术设备,马上就可以建立联系,而无须用户进行任何设置,可以解释成“即连即用”。
这在无线电环境非常嘈杂的环境下,它的优势就更加明显了。
蓝牙技术的另一大优势是它应用了全球统一的频率设定,这就消除了“国界”的障碍,而在蜂窝式移动电话领域,这个障碍已经困扰用户多年。
另外,ISM频段是对所有无线电系统都开放的频段,因此使用其中的某个频段都会遇到不可预测的干扰源。
例如某些家电、无绳电话、汽车房开门器、微波炉等,都可能是干扰。
为此,蓝牙技术特别设计了快速确认和跳频方案以确保链路稳定。
跳频技术是把频带分成若干个跳频信道(Hop Channel),在一次连接中,无线电收发器按一定的码序列不断地从一个信道跳到另一个信道,只有收发双方是按这个规律进行通信的,而其它的干扰不可能按同样的规律进行干扰;跳频的瞬时带宽是很窄的,但通过扩展频谱技术使这个窄带或成倍地扩展成宽频带,使干扰可能的影响变成很小。
与其它工作在相同频段的系统相比,蓝牙跳频更快,数据包更短,这使蓝牙技术比其它系统都更稳定。
蓝牙适配器基础知识单选题100道及答案解析1. 蓝牙适配器是一种用于实现设备之间()通信的硬件设备。
A. 有线B. 无线C. 红外D. 光纤答案:B解析:蓝牙适配器的主要作用是实现设备之间的无线通信。
2. 蓝牙适配器通常通过()接口与计算机连接。
A. USBB. PS/2C. VGAD. HDMI答案:A解析:USB 接口是蓝牙适配器常见的连接接口,方便且通用性强。
3. 以下哪个不是蓝牙适配器的常见工作频段?A. 2.4GHzB. 5GHzC. 5.8GHzD. 6GHz答案:D解析:蓝牙工作在2.4GHz 的ISM 频段,一般不涉及5GHz、5.8GHz 和6GHz 频段。
4. 蓝牙适配器的有效传输距离一般在()米范围内。
A. 5B. 10C. 15D. 20答案:B解析:蓝牙适配器的有效传输距离通常在10 米左右。
5. 蓝牙适配器支持的最大传输速率约为()。
A. 1MbpsB. 2MbpsC. 3MbpsD. 4Mbps答案:B解析:蓝牙适配器的最大传输速率约为2Mbps 左右。
6. 以下哪种设备通常不需要蓝牙适配器来实现蓝牙功能?A. 笔记本电脑B. 台式电脑C. 智能手机D. 平板电脑答案:C解析:智能手机一般自身已内置蓝牙功能,无需额外的蓝牙适配器。
7. 蓝牙适配器的版本越高,通常意味着()。
A. 传输距离越远B. 传输速率越快C. 兼容性越好D. 以上都是答案:D解析:蓝牙适配器版本的提升会带来传输距离、传输速率和兼容性等方面的改进。
8. 要使蓝牙适配器正常工作,需要在设备上安装()。
A. 驱动程序B. 办公软件C. 杀毒软件D. 游戏软件答案:A解析:安装驱动程序是确保蓝牙适配器在设备上正常工作的必要步骤。
9. 蓝牙适配器可以连接的设备不包括()。
A. 蓝牙耳机B. 蓝牙音箱C. 蓝牙键盘D. 无线路由器答案:D解析:无线路由器不是通过蓝牙连接的,而是通过Wi-Fi 技术。
10. 以下关于蓝牙适配器的说法,错误的是()。
蓝牙技术知识点一、知识概述《蓝牙技术》①基本定义: 蓝牙技术呢,简单来说就是一种短距离的无线通信技术,能让各种电子设备之间轻松地进行数据传输,就好比是给设备之间搭建了一座无形的短距离通信小桥梁。
②重要程度: 在现代电子设备领域那可相当重要。
咱现在好多设备都有蓝牙功能,像手机与蓝牙耳机、手机与蓝牙音箱的连接都靠它,它让设备连接摆脱了那些复杂的线缆,使用起来更方便,在物联网发展里也起了很大的推动作用。
③前置知识: 首先得对无线电波有个基本概念,知道设备之间是通过发送和接收某种信号来通信的。
再一点就是对数据传输要有个大概了解,比如什么是传输数据之类的。
④应用价值: 应用场景可太多了。
我自己就经常用蓝牙,拿手机连接我的蓝牙耳机在路上听歌,在办公室用手机蓝牙连蓝牙音箱,特别方便。
它还能用于汽车上,把手机和汽车多媒体系统连接起来方便接打电话或者播放音乐。
甚至有些医疗设备也靠蓝牙传输数据。
二、知识体系①知识图谱: 在通信技术这个大范畴里,蓝牙技术算是一种比较独特的短距离无线通信分支。
它与WiFi啊,NFC啊,这些技术共同组成了设备连接的网络。
②关联知识: 和无线通信原理关联紧密,像无线电频率分配这些知识都是有关联的。
并且和设备兼容性知识也有关,毕竟不同设备的蓝牙功能得匹配才能正常工作。
③重难点分析: 掌握难度不算特别大。
重点就是蓝牙的连接原理以及不同蓝牙版本之间的差异。
有时候可能会对蓝牙的安全机制有点迷惑,这就是关键点之一,毕竟要保证数据传输安全。
④考点分析: 在电子设备相关专业的考试里,可能会考查蓝牙的工作频段、传输距离、蓝牙的配对方式等。
一般会以选择题或者简答题的形式出现,比如让你列出蓝牙一个主要特点之类的。
三、详细讲解【理论概念类】①概念辨析: 蓝牙技术的核心概念就是利用特定频段的无线电波进行短距离内设备间的数据交换。
比如说,当你的手机要连接蓝牙耳机的时候,手机先发出蓝牙信号在周围找,蓝牙耳机接收到这个信号后就和手机建立连接。
Bluetooth BasicsBluetooth Overviewn Wireless technology for short-range voice and data communicationn Low-cost and low-powern Provides a communication platform between a wide range of “smart”devicesn Not limited to “line of sight”communicationPDA Cordless Phone InkjetScannerHome Audio System ComputerDigital CameraSynchronizationn Keep data on different devices synchronized without using a cablen Example:n Walk into office and have your PDA synchwith your laptop on your desk without even taking your PDA out of your briefcaseConnecting to Internetn Being able to gain access to the Internet by using “Bluetooth access points”n Access point is used as a gateway to theinternetn Both the access point and the device areBluetooth-enabledn An example of Service Discovery Protocol n Access point provides a service to the deviceFrequency Hopping Spread Spectrumproblem was that radio-controlled torpedosand changing frequencies" all the time. AtAntheil gave Lamarr most of the credit, but, the changingDevice Discovery IllustratedD A10 metersM NLPO QB CF KJ G I EH Note that a device can be “Undiscoverable ”After inquiry procedure, A knows about others within range Issues with Inquire Messages n Are the inquirer transmitting and the receiver listening on the same frequency? n Since they are not yet connected, they are on totally different hop sequences, and most likely on different channelsn If they are on the same frequency, what if they are on a noisy channel?n Bluetooth provides the capability for receivers to issue multiple inquiry responsesMain Idea Behind Inquire n Inquiring device sends out an inquire on 16 different frequencies (16 channel train) n Receiver (device in standby mode), performs an inquire scan long enough for an inquiring device to send the inquire on 16 frequencies n Receiver does an inquire scan frequent enough so that it is guaranteed to wake up during a 16 channel trainInquiry Hop Train16 Channel Train24681012141618024681012141618SlotI nq ui ry Ch an n el Series1The Numbers Behind Inquire n Each full scan of a 16 channel train takes about 1.28 secondsn 16 channels * 625us * 128 trains = 1.28 seconds n One full 16 channel train takes 10ms.n Receiver enters inquiry scan state at least once every 1.28 seconds, and stays in that state for 10ms.What about noise?n Devices always reply to received inquiry messages with an inquiry responsen An inquirer is allowed to received multipleresponses from one devicen In order to account for the fact that channels can be noisy and transmissions can get lost, the 128 train scan is repeated up to 4 times for each train (10.24 seconds)n Designed to successfully communicate at leastonce with all devices within rangeInquiryn Uses 32 inquire channels to send out inquiry messagesn Send out inquiry on 32 channels, broken up into 2 inquiry hop trains (16 different channels to transmit packets)n Intended to catch a device in inquiry scan mode on one of the 32 inquire channelsInquiry Scann A device periodically listens for inquiry packets at a single frequency – chosen out of 16 frequenciesn Inquiry hop sequence depends on device address n Stays in the state long enough for a inquiring device to cover 16 frequenciesn Will re-enter inquiry scan state even after responding to an inquireInquiry Responsen When radio receives inquire, it will wait between 0 and .32 seconds before sending an FHS packet as a responsen This is done to avoid collision with another radiothat also wants to send an FHS packetn FHS Packet contains:n Device IDn Clockn After inquiring radio is done with inquiring procedure, it knows all of the radios (that are discoverable) within rangePaging: Will you connect to me?n Very similar to inquiren Still have not synchronized clocks or frequenciesn Establishes actual Piconet connection with a device that it knows aboutn Connection process involves a 6 steps of communication between the the master and the slaveStep Message Direction HoppingPatternPattern Sourceand Clock1 Slave ID Master to Slave Page Slave2 Slave ID Slave to Master Page Response Slave3 FHS Master to Slave Page Slave4 Slave ID Slave to Master Page Response Slave5 1st Master Packet Master to Slave Channel Master6 1st Slave Packet Slave to Master Channel MasterPaging IllustratedD EF HG I KJ CM NLPO QB A10 metersStep 1: The Page Command n Device broadcasts a page message out to the device that it wants to set up a connection withn Does this in a similar manner as inquire messages (on 2 frequency trains of 16 frequencies each)n Once the device receives a page response, it will stop paging and move on to step 2Paging: Steps 2 & 3n Step 2: In the page response, an acknowledgement is sent back to the master containing the slave IDn Step 3: In the master response, the frequency hopping generator is stopped and the master issues an FHS packet to the slavePaging: Step 4n The slave issues a final slave response transmission that is aligned to the slave’s native clockn Using the data from the FHS packet, the slave calculates adopts the master’s frequency hopping pattern and synchronizes to its clockPaging: Step 5n When the master receives the packet, it jumps back to its frequency hopping pattern and assigns the slave an Active Member Address (AMA) for the piconet n Master sends out a poll packet to ensure that the slave is on its frequency hopping patternPaging: Step 6n Once the slave receives the poll packet, the slave replies with any kind of packet to ensure that it is on the right channeln The acknowledgement must be received by the Master within the timeout periodn At the conclusion of step 6, a new synchronized connection is established between the master and the slaveLink Managern Performs all link creation, management, andtermination operationsn Responsible for all the physical link resources in the systemn Handles the control and negotiation of packet sizes usedwhen transmitting datan Controls Operation Modes for devices in a piconetn Sets up, terminates, and manages basebandconnections between devicesn Establishes different types of links dependent on requestsfrom the L2CAP layern Synchronous Connection-Oriented (SCO)n Asynchronous Connection-Less (ACL)Asynchronous Connection-Less (ACL)n Designed for data trafficn Packet switched connection where data is exchanged sporadically as and when data is available from higher up the stackn Data integrity is checked through error checking and retransmissionn One ACL link between a master and a slaveSynchronous Connection Oriented (SCO)n Intended for use with time-bounded information such as audio or videon Provides a circuit-switched connection where data is regularly exchangedn Retransmission is not necessary, since data is real-timen Up to 3 SCO links per piconetACL Links vs. SCO LinksIntended Traffic Type Retransmission Max # linksbetween masterand slaveSupportedduring holdmodeSwitchedconnectiontypeACL Data Yes 1 No PacketSCO Time boundedinfo (Audio orVideo)No 3 Yes CircuitActive Moden Limited to 7 Active slaves for each master n Three bit address (AM_ADDR) given to each active slaven Unit actively participates on channeln Can receive communications in any given framen Active slaves are polled by master for transmissionsn Unit operates on high-powerHold Moden Frees slave ton Attend another Piconetn Perform scanning, paging, or inquiry operations n Move into low-power sleepn Unit keeps active member addressn Unit does not support ACL packets on the channel but may support SCO packetsn Master and slave agree on a one time hold duration after which the slave revives and synchronizes with channel trafficn Unit operates on low-powerSniff Moden Very similar to hold moden Slave is freed for reoccurring fixed time intervalsn Master can only communicate during arranged “sniff” time slotsPark Moden Parked unit gives up active member address and is assignedn 8 bit Parked member address (PM_ADDR)– allows master to unpark slaven 8 bit Access request address (AR_ADDR) –allows slave to ask master to unpark itn Unit stays synchronized to channeln Operates in very low-power sleepPark Mode (cont.)n Provides the ability to connect more than 7 devices to a master (8 bitPM_ADDR allows 255 parked devices)n Active and Parked slaves can be switched in and out to allow many connections to a single piconetPark Mode (cont.)n Master establishes a beacon channel and beacon interval when a slave is parkedn Parked slave wakes up at regular beacon interval ton Maintain synchronizationn Listen for “broadcast” messages (packets with allzero AM_ADDR)n Potentially make access request to master through (AR_ADDR)Park Mode (cont.)n Beacon slots must have at least “null”master-to-slave trafficn Master-to-slave transmissions may extend over multiple beacon slotsSecurityn Link manager provides mechanism used by devices at either end of a link forn Negotiating encryption moden Coordinating encryption keysn Baseband handles encryption and key generationHost Controller Interface (HCI) n Most Bluetooth systems consist of two processors:n The higher layers of the protocol stack (L2CAP,SDP, RFCOMM) are run on the host device’sprocessorn The lower layers of the protocol stack (Basebandand radio) are run on specific Bluetooth hardwaren HCI provides an interface between the higher and the lower layers of the protocol stackHCI Flow Controln Main function of the Host Controller Interfacen Many times higher layer protocols have data rates much larger than data rate across Bluetooth radio and air interfacesn Also need to handle the reverse situationwhen the host cannot accept data as fastas the Bluetooth module can send itRFCOMMn Cable replacement protocol allowing applications built to interface with serial port to function seamlessly with bluetoothn Emulates serial port over the L2CAP protocol by specifying how a data stream can be emulatedn RFCOMM actually handles parallel dataEmulating the Serial Portn Typically, the receive and transmit lines are connected to a UART (UniversalAsynchronous Receiver Transmitter)n Job of the UART is to convert between serial datasent down cables and the parallel data processingwhich devices usen Since software that deals with serial ports view the data after it has been through UART, it only sees the parallel datan RFCOMM protocol only works with parallel data byconnecting to the lower layers via L2CAPService Discovery Protocol (SDP) Idea:n Traditional LANs: Find a connection to a printer (or other resource) and keep that connection for a long timen Bluetooth: Walk into an area, find a printer (or other resource), use it, then walk away forgetting any details of the connectionSDP Client/Server Modeln SDP Server is any Bluetooth device that offers services to other Bluetooth device (ex. Bluetooth-enabled printer, etc.)n Each SDP Server maintains its owndatabase that contains information aboutthe services that it offersn SDP Client is any Bluetooth device that uses the services offered by an SDP ServerSDP Databasen SDP Database is a set of records that describes the different services that the server can provide to another Bluetooth devicen When the SDP server gets a query, it looks up the service that the client is requesting and returns information to the client on how to connect to the serviceUsing the Servicesn The SDP client establishes a separate (non-SDP) connection to use the servicen SDP connection is only used to determineservice availabilityn The L2CAP connection uses to get information for the service can be dropped (if no more services are needed) or retained (if the client still needs more services from the server)Logical Link Control and Application Protocol (L2CAP)n Performs 4 major functionsn Managing the creation and termination of logicallinks for each connection through “channel”structuresn Enforcing and defining QoS requirementsn Adapting Data, for each connection, betweenapplication (APIs) and Bluetooth Basebandformats through Segmentation and Reassembly(SAR)n Performing Multiplexing to support multipleconcurrent connections over a single commonradio interface (multiple apps. using link betweentwo devices simultaneously)Segmentation/Reassemblyn Baseband packet size is limitedn Can handle payload of 2745 bitsn L2CAP accepts packet size up to 64kbn L2CAP segments large packets into smaller baseband manageable packetsn Smaller received baseband packets are reassembled coming back up the protocol stackQuality of Servicen Applications may demand QoS on specific parametersn Peak bandwidthn Latencyn Delay variationn Token raten Token bucket sizen L2CAP provides requested QoS if possible and notifies application if link can not support demandsProtocol Multiplexingn Applications may access L2CAP through different support protocolsn Service Discovery Protocol (SDP)n RFCOMMn Telephony Control Protocol Specification (TCS)n Baseband is not concerned with operation protocols meaning L2CAP must distinguish between themBasebandProtocol Multiplexing Illustrated LMP AudioL2CAP SCOACL VoiceTCS RFCOMM SDP Summaryn Advantages of Bluetoothn Low power consumptionn Low price on Bluetooth componentsn Non line-of-sightn Disadvantages of Bluetoothn Wireless LANs offer faster data rates and larger communication rangesn Possibility of interference on 2.4GHz frequency bandSourcesn /bluetooth/bluetoothf/n http://www.ee.iitb.ernet.in/uma/~aman/bluetooth/n /tech_xfer/ppt/bt_tut.pdfn /esp/bluetooth/tutorials/index.htm n /infotooth/download.aspn /bluetooth/index.htmln Bluetooth: Connect without Cables by Jennifer Grayn Discovering Bluetooth by Brent A. Miller。