低功耗蓝牙BLE跳频算法
本帖最后由 test4 于 2022-10-28 16:13 编辑新人快速入门蓝牙
https://www.52bluetooth.com/forum.php?mod=viewthread&tid=85133&fromuid=60710
(出处: 我爱蓝牙网 - 52Bluetooth - 最具人气蓝牙技术交流网站)
本文接“经典/低功耗蓝牙跳频协议详解(1)”
全文请关注微信,知乎公众号“学问第一课”阅读
低功耗蓝牙跳频算法有两种:
Channel Selection Algorithm #1 (CSA1#)
Channel Selection Algorithm #2 (CSA2#)
1.CSA 1#
在连接事件中应用CSA1#算法,整个计算过程如下。
在连接事件开始时,unmappedChannel计算过程如下图。
图片
图1 CSA 1# 算法
基本流程如下:
unmappedChannel = (lastUnmappedChannel + hopIncrement) mod 37
hopIncrement表示跳频增量。当连接事件关闭时,lastUnmappedChannel将被设置为 unmappedChannel的值。如果unmappedChannel是可用信道,CSA#1使用unmappedChannel作为此次数据连接事件的可用信道index。如果unmappedChannel是不可用信道,则重新计算:
remappingIndex = unmappedChannel mod numUsedChannels
其中numUsedChannels是可用信道数。
remappingIndex指向可用信道表某一可用信道index。可用信道表里的信道index是升序排列的。BLE信道index。
2.CSA 2#
余下文章请移步:
全文请关注微信,知乎公众号“学问第一课”阅读 支持起来 一起学
页:
[1]