当前位置:网站首页>经典蓝牙的连接过程
经典蓝牙的连接过程
2022-07-26 10:51:00 【deparks】
经典蓝牙的连接过程
想要了解蓝牙的连接过程,必须先了解3个概念:
1,链路Link:物理链路,是基带协议中的概念,包括ACL链路和SCO链路两种,前者主要用于传递数据,后者传递语音。一对蓝牙设备,只存在一条ACL链路,允许存在3条SCO链路
2,信道channel: 这是L2DAP协议中的概念,是逻辑信道,信道的端点用信道标示符CID表示,用两个字节表示,所以最多存在65536个信道.即一条ACL链路可以存在最多65536个信道.信道包括信令信道和数据信道,通过信令信道建立数据信道,然后由数据信道传输数据.信令信道的CID为0x0001
3,连接connection:应用剖面上的概念,有了该剖面的connection,才能进行该剖面的服务和应用。
其中link establishment部分由LMP实现,channel establishment部分由L2CAP实现,connection establishment就是由具体的应用剖面(profile)来实现了。
我们以生活中常用的手机与蓝牙耳机之间的连接来详细分析蓝牙的连接过程:
首先,主设备(master,即发起连接的设备,这里指手机)会寻呼(page)从设备(slave,接收连接的设备,这里指蓝牙耳机),master会已跳频的方式去寻呼slave,slave会固定间隔地去扫描(scan)外部寻呼,即page scan,当scan 到外部page时便会响应response该page,这样两个设备之间便会建立link的连接,即ACL链路的连接。当ACL 链路连接建立后,主设备会发起channel的连接请求,即L2CAP的连接,建立L2CAP的连接之后,主设备采用SDP去查询从设备的免提服务,从中得到rfcomm的通道号,然后主设备会发起rfcomm的连接请求建立rfcomm的连接。然后就建立了应用的连接。
即link establish->channel establish->rfcomm establish->connection
边栏推荐
- [dectectron2] follow the official demo
- 2021-08-12 function recursion_ Learn C language with brother Peng
- PLC与伺服电机连接
- 349. 两个数组的交集
- 菜鸟看源码之SparseArray
- Many people don't know whether they are looking for Kanban software or Kanban software
- pytest 前后置方法
- 使用float实现左中右布局,中间内容自适应
- Implementing queues with two stacks
- Flutter编译报错 version of NDK matched the requested version 21.0.6113669. Versions available locally: 2
猜你喜欢

Bash shell学习笔记(三)

Newbie sees the source code arraydeque

Successfully transplanted stemwin v5.22 on Shenzhou IV development board

nmap弱点扫描结果可视化转换

349. 两个数组的交集

35. 搜索插入位置

242. Effective letter heteronyms

Linkedblockingqueue of novice source code

Bash shell learning notes (I)
![Error[pe147]: declaration is incompatible with 'error problem](/img/4f/57145d78f4dc1fe84d2f271dd9d82f.png)
Error[pe147]: declaration is incompatible with 'error problem
随机推荐
Capture ZABBIX performance monitoring chart with selenium
二叉树的遍历 递归+迭代
pytest fixture装饰器
344.反转字符串
27.移除元素
Pengge C language - minesweeping 2021-08-16
104.二叉树的最大深度
-bash: ./build.sh: /bin/bash^M: 坏的解释器: 没有那个文件或目录
Traversal recursion + iteration of binary tree
13 managing resources by objects
Wechat official account message notice "errCode": 40164, "errmsg": "invalid IP
PLC与伺服电机连接
Sword finger offer (49): convert a string to an integer
MFC图片控件
Sword finger offer (twenty): stack containing min function
字典与int矩阵
242. Effective letter heteronyms
How to assemble a registry?
2021-08-14 Sanzi chess
ThreadPoolExecutor是怎样执行任务的