Bluetooth 蓝牙介绍(三):低功耗蓝牙BLE空口协议Ⅰ


空口协议包括 multiple access scheme, devicediscoveryLink Layer connection methods 三大部分。

帧空间

同一信道索引上的两个连续数据包之间的时间间隔(time interval)被称为帧间空间。它被定义为从前一个数据包的最后一位结束到后续数据包的第一位开始的时间。 帧间空间指定为“T_IFS”并且应为 150 μs。

包含 AuxPtr 的数据包与其指示的附加数据包(auxiliary packet)之间的最小时间间隔称为最小 AUX 帧空间(the Minimum AUX Frame Space)。它被定义为从包含 AuxPtr 的数据包的最后一位结束到附加数据包开始的最短时间。 最小 AUX 帧空间指定为T_MAFS并且应为 300 μs。

在这里插入图片描述
一个子事件(subevent)中最后一个数据包的最后一位结束与下一个子事件中第一个数据包的第一位开始之间的最小时间间隔称为最小子事件空间。最小子事件空间被指定为T_MSS并且应为 150 μs。。图 4.2 说明了最小子事件空间应用于 CIS 的示例。图 4.3 举例说明了最小子事件空间在 BIS 中的应用。

在Bluetooth 5.2 中新增了等时广播者与同步接收者之间通过广播信道传输同步数据流BIS,一个或多个BIS 可组成BIG,每个BIG(Broadcast Isochronous Group)最多包含31个BIS。等时同步广播通信也是一种一对多的通信方式,只能进行单方向通信,比如可以让听讲座的众多观众借助支持该通信模式的蓝牙耳机同步听到一个演讲者等时广播的音频数据流;

同样在Bluetooth 5.2新增传输CIS(Connected Isochronous Stream)等时同步数据流的能力,每个CIS 承载一个单独的等时同步数据流,一个或多个CIS 可组成CIG(Connected Isochronous Group),每个CIG 最多包含31个CIS。

在这里插入图片描述
在这里插入图片描述

时序要求

链路层应使用两种可能的时钟精度之一:在第 4.2.1 节中描述的情况下,它应使用活动时钟精度(active clock accuracy);否则应使用睡眠时钟精度(sleep clock accuracy)。

本节中指定的时钟精度仅适用于传输数据包的设备。 用于对数据包接收计时的时钟可能具有任何准确性,但接收设备需要考虑到这一点。

例如,如果接收设备时钟的精度为 2000 ppm,最大抖动为 45 μs,那么,对于上次同步时序的事件后 1 秒的事件,设备将需要至少提前 2045 μs 开始侦听 并继续收听,直到至少比其他情况晚 2045 微秒。

在连接、BIG 或 CIG 事件期间、主动扫描期间以及请求连接期间,数据包传输的平均时序是使用主动时钟精度确定的,drift(Drift: The difference in rates of two clocks,时钟频率上的不一致) 小于或等于±50 ppm。所有瞬时计时与平均计时的偏差不得超过 2 μs。

在这里插入图片描述

所有其他活动的平均时间是使用睡眠时钟精度确定的,drift 小于或等于 ±500 ppm。所有瞬时计时与平均计时的偏差不得超过 16 μs。 活动时钟的最坏情况漂移和瞬时偏差应小于或等于睡眠时钟。

当两个设备相距超过几米时,与活动时钟精度相比,信号在它们之间传播所花费的时间将非常重要。当设备正在侦听可能达 D 米远的数据包时,它应该在数据包传输的标称最晚时间(例如 T_IFS + 2 μs)之后侦听额外的 2D * 4 ns。

在这里插入图片描述
在各种情况下,链路层期望在某个窗口内(从 receiveWindowStart 扩展到 receiveWindowEnd)或在某个时间(在这种情况下 receiveWindowStart 和 receiveWindowEnd 都在那个时间)接收数据包,但是,由于活动时钟精度和睡眠时钟精度,发送链路层的那个窗口的确切时间存在不确定性。

因此,接收者应调整其收听时间以考虑到这种不确定性。 收听时间的增加称为window widening。 假设时钟误差纯粹以百万分之几 (ppm) 为单位,计算如下:

在这里插入图片描述
接收者应该在 receiveWindowStart 之前的 windowWidening 开始监听,直到 receiveWindowEnd 之后的 windowWidening。

ACL 连接中的 windowWidening 应小于((connInterval ÷ 2) - T_IFS μs)。 如果 windowWidening 在幅度上达到 ((connInterval ÷ 2) - T_IFS μs),则应认为连接丢失。

如果 NSE < 3 的 CIS 或 BIS 的窗口加宽幅度达到 ((ISO_Interval ÷ 2) - T_IFS) μs,则链路层应终止 CIS或停止与 BIG 同步。如果 NSE ≥ 3 的 CIS 或 BIS 的 windowWidening 在幅度上达到 Sub_Interval,则链路层应终止 CIS 或停止与 BIG 同步。


链路层设备过滤

BLE 提供设备地址过滤机制,设备的过滤机制是基于 White List。旨在Link Layer进行设备回应机制的最小化。在不同的 State 会有不同的 filter 策略,按照 State 来分为:

  1. Advertising State 过滤策略
  2. Scanning State 过滤策略
  3. Initiating State 过滤策略
  4. Periodic sync establishment State 过滤策略

advertising Filter Policy 过滤策略指明了 Advertising 如何处理 Scan 和 Connection 请求。注:如果 Link Layer 使用如下类型的广播,那么 Advertising Filter Policy 过滤策略被忽略:

  • non-connectable and non-scannable directed advertising events
  • scannable directed advertising events
  • connectable directed advertising events

Advertising Filter Policy 过滤策略有 4 种 Mode,并且同一时间只能处于其中一种 Mode:

  • The Link Layer shall process scan and connection requests from all devices(i.e. the White List is not in use). This is the default on reset :Link Layer可以接受任何设备的 Scan 和 connection 请求(最不严格,Controller reset后的默认状态),此时白名单无作用。

  • The Link Layer shall process connection requests from all devices and shall only process scan requests from devices that are in the White List :Link Layer可以接受任何设备的 connection 请求,但只接受位于白名单中的设备的 Scan 请求

  • The Link Layer shall process scan requests from all devices and shall only process connection requests from devices that are in the White List :Link Layer可以接受任何设备的 Scan 请求,但只接受位于白名单中的设备的 connection 请求。

  • The Link Layer shall process scan and connection requests only from devices in the White List :。Link Layer只接受位于白名单中的设备的 Scan 和 connection 请求(最严格)。

因为 Scanner 只和 Advertising 交互,故 Scanner Filter Policy 指明了扫描者如何处理 Advertising Packages,在同一时刻,使用且仅仅只能使用下述策略中的一种过滤策略:

  • The Link Layer shall process all advertising and scan response PDUs (i.e., the White List is not used). However, a directed advertising PDU not containing the scanner’s device address shall be ignored. This is the default on reset :Link Layer 处理所有设备的广播数据,并且忽略没有包括自身地址的 Connectable Directed advertising packet(Controller reset后的默认状态),此时白名单无作用。

  • The Link Layer shall process advertising and scan response PDUs only from devices in the White List. A directed advertising PDU not containing the scanner’s device address shall be ignored :Link Layer 只处理位于白名单中的设备的广播数据,并且忽略没有包括该 Scanner 的 Connectable Directed advertising packet;

注:如果 Link Layer 支持 Extended Scanner Filter 策略,则下述策略也需要支持:

  • The Link Layer shall process all advertising and scan response PDUs (i.e., the White List is not used). However, a directed advertising PDU shall be ignored if the TargetA is neither the scanner’s device address nor a resolvable private address :Link Layer 只处理位于白名单中的设备的广播数据,并且不能忽略InitA地址为“resolvable private address”的connectable Directed advertising packet;
  • The Link Layer shall process advertising and scan response PDUs only from devices in the White List. A directed advertising PDU shall be ignored if the TargetA is neither the scanner’s device address nor a resolvable private address :Link Layer处理所有设备的广播数据,并且不能忽略InitA地址为“resolvable private address”的connectable Directed advertising packet。

因为 Initiator 只和 Advertising 交互,故 Initiator Filter Policy 指明了扫描者如何处理 Advertising Packages,在同一时刻,使用且仅仅只能使用下述策略中的一种过滤策略:

  • The Link Layer shall ignore the White List and process connectable advertising PDUs from a specific single device specified by the Host :Link Layer只处理位于白名单中的设备发送的可连接的广播包,并在收到的时候发起连接请求;
  • The Link Layer shall process connectable advertising PDUs from all devices in the White List :忽略白名单,Link Layer处理由Host指定的设备所发送的可连接的广播包,并在收到的时候发起连接请求。

定期同步建立过滤器策略决定了扫描器的链路层在尝试与定期广播序列同步时如何处理广播 PDU。 链路层应使用HOST配置的以下周期性同步建立过滤策略模式之一:

  • The Link Layer shall ignore the Periodic Advertiser List and process advertising PDUs from a specific single device specified by the Host :链路层应忽略周期性广播列表并处理来自HOST指定的特定单个设备的广播 PDU。

  • The Link Layer shall process advertising PDUs from all devices in the Periodic Advertiser List :链路层应处理来自周期广播列表中所有设备的广播PDU。

NON-CONNECTED STATES

Standby state

待机态是链路层中的默认状态。链接层不得在待机状态下发送或接收数据包。链接层可能离开待机态进入Advertising state, Scanning state, Initiator state, Synchronization state, Isochronous Broadcasting state

Advertising state

链接层应在host发送指令时进入广播状态。当进入广播状态中时,链路层应在广播事件、定期广播事件或两者中发送广播PDU(ADV_IND、ADV_DIRECT_IND、ADV_NONCONN_IND、ADV_SCAN_IND、 ADV_EXT_IND、 AUX_AD

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值