蓝牙耳机或者音响设备中,蓝牙回连是经常碰到的,这里也经常出问题,这里我就梳理一下,看看协议栈怎么讲的。
回连的流程一般是这样的,耳机重新打开或者耳机距离远断开后又距离拉近,这时候就会启动回连,一般是耳机要回连接手机的,协议栈的命令是这个:
:
流程描述如下,感觉自己怎么翻译也没有蓝牙协议栈上说的清楚,就原班过来了:
The Accept_Connection_Request command is used to accept a new incomiing connection request. The Accept_Connection_Request command shall only be
issued after a Connection Request event has occurred. The Connection Request event will return the BD_ADDR of the device which is requesting the
connection. This command will cause the Link Manager to create a connectio to the BR/EDR Controller, with the BD_ADDR specified by the command
parameters. The Link Manager will determine how the new connection will be established. This will be determined by the current state of the device, its
piconet, and the state of the device to be connected. The Role command parameter allows the Host to specify if the Link Manager shall request a role
switch and become the Master for this connection. This is a preference and not a requirement. If the Role Switch fails then the connection will still be accepted,
and the Role Discovery Command will reflect the current role.
Note: The Link Manager may terminate the connection if it would be low on resources if the role switch fails. The decision to accept a connection must be
completed before the connection accept timeout expires on the local Bluetooth Module.
Note:When accepting synchronous connection request, the Role parameter is
not used and will be ignored by the BR/EDR Controller.
成功标志:
The Accept_Connection_Request command shall cause the Command Status event to be sent from the BR/EDR Controller when the BR/EDR Controller
begins setting up the connection. In addition, when the Link Manager determines the connection is established, the local BR/EDR Controller shall
send a Connection Complete event to its Host, and the remote Controller will send a Connection Complete event or a Synchronous Connection Complete
event to the Host. The Connection Complete event contains the Connection_Handle if this command is successful.
Note: No Command Complete event will be sent by the BR/EDR Controller to indicate that this command has been completed. Instead, the Connecti No Command Complete event will be sent by the BR/EDR Controller to indicate that this command has been completed. Instead, the Connection Complete event will indicate that this command has been completed.
参考文档:蓝牙5.0协议
作者:虚生 出处:https://www.cnblogs.com/dylancao/ 以音频和传感器算法为核心的智能可穿戴产品解决方案提供商 ,提供可穿戴智能软硬件解决方案的设计,开发和咨询服务。 勾搭热线:邮箱:1173496664@qq.com weixin:18019245820 市场技术对接群:347609188 |
![]() |
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
2018-07-10 编译u-boot问题总结