当前位置: 首页 > news >正文

蓝牙连接hci 命令和事件的交互

参考:在HCI层看蓝牙的连接过程_hci 获取蓝牙pin码-CSDN博客

我这边查看的是core 5.2

一、数据交互流程

1、ACL连接建立后的可选流程

参考蓝牙core5.2: vol2 --> PartF --> 4

1.1 AUTHENTICATION REQUESTED

Authentication can be explicitly executed at any time after a
connection has been established. If no Link Key is available then the Link Key
is required from the Host.

身份验证可以在连接建立后的任何时间显式执行。如果没有可用的链接密钥,则需要主机提供链接密钥

1.2 简单配对信息交互

2、SYNCHRONOUS CONNECTION SETUP (SCO和ESCO连接流程)

Using the HCI_Setup_Synchronous_Connection command, a Host can add a
synchronous logical channel to the link. A synchronous logical link can be
provided by creating a SCO or an eSCO logical transport.
Note: An ACL connection must be established before a synchronous
connection can be created.

HCI Setup Synchronous Connection命令用来在链路上添加同步逻辑通道。同步逻辑链路可以通过创建SCO或eSCO逻辑传输来提供。

注意:创建同步连接前,必须先建立ACL连接

分三个场景,这儿只列出来一个场景

二、hci命令和事件

Link Key Request Reply command

core5.2: vol4 --> PartE --> 7.1.10

Description:
The HCI_Link_Key_Request_Reply command is used to reply to an
HCI_Link_Key_Request event from the Controller, and specifies the Link Key
stored on the Host to be used as the link key for the connection with the other
BR/EDR Controller specified by BD_ADDR. The HCI_Link_Key_Request
event will be generated when the BR/EDR Controller needs a Link Key for a
connection.
When the BR/EDR Controller generates an HCI_Link_Key_Request event in
order for the local Link Manager to respond to the request from the remote Link
Manager (as a result of an HCI_Create_Connection or
HCI_Authentication_Requested command from the remote Host), the local
Host shall respond with either an HCI_Link_Key_Request_Reply or
HCI_Link_Key_Request_Negative_Reply command before the remote Link
Manager detects LMP response timeout.

翻译:HCI Link Key Request Reply命令用于回复控制器发出的HCI Link Key Request事件,并指定存储在主机上的Link Key作为与BD ADDR指定的另一个BR/EDR控制器连接的Link Key。当BR/EDR控制器需要用于连接的Link Key时,将生成HCI Link Key Request事件。当BR/EDR控制器生成HCI链路密钥请求事件,以便本地链路管理器响应来自远程链路管理器的请求时(作为HCI创建连接或HCI认证请求的结果)

困惑1:Link Key Request一开始以为是一个hci命令,由host发起,但是却在命令里找不到这个,只能找到Link Key Request Reply?

答:Link Key Request event  是一个事件,是从controller里向host发起的,不是由蓝牙协议栈发起, 在蓝牙core的 在vol4 --> PartE --> 7.7.23

相关文章:

  • OpenSceneGraph相机系统
  • 求x的c(n,m)次方
  • 智慧零售新引擎!数图将亮相CHINASHOP 2025,助力企业降本增效
  • MCP基础学习二:MCP服务搭建与配置
  • repo仓库文件清理
  • Uniapp使用onShow语法报before initialization
  • 使用 Ktor 构建现代 Android 应用的后端服务
  • 数字世界的免疫系统:恶意流量检测如何守护网络安全
  • Java—HTML:3D形变
  • systemd 与 SysVinit
  • SmolVLM2: The Smollest Video Model Ever(三)
  • arco-design-vue:给<a-table>组件每一行添加data-id属性,并根据id数组是否包含此行id进行样式处理
  • 使用 Spring Boot 和 Uniapp 搭建 NFC 读取系统
  • 若依框架二次开发——RuoYi-AI 本地部署流程
  • 动态规划基础
  • ISP--Demosaicking
  • 学习51单片机Day02---实验:点亮一个LED灯
  • SpringDoc【使用详解】
  • 解决RecyclerView在调用smoothScrollToPosition后最后一个item底部超出屏幕的问题
  • Word / WPS 页面顶部标题 段前间距 失效 / 不起作用 / 不显示,标题紧贴页眉 问题及解决
  • 做网站万网/百度seo流量
  • 有哪些网站教做吃的/电商关键词查询工具
  • 辽宁朝阳哪家做网站好/国际军事新闻最新消息视频
  • 无锡建设网站的公司哪家好/国际新闻最新消息今天军事新闻
  • 可信网站认证/百度手机助手下载2021新版
  • 广西建设厅网站行业网/网页开发需要学什么