当前位置:网站首页>Bluetooth development (6) -- literacy of Bluetooth protocol architecture
Bluetooth development (6) -- literacy of Bluetooth protocol architecture
2022-06-11 00:08:00 【yuanyun_ elber】
Bluetooth protocol architecture literacy

The protocol architecture of Bluetooth is really diverse , We've met before , With hci Layer differentiation host and controller The Chu River Han boundary , Then subdivide the two sides ,hci Below the floor lc、lmp layer ,hci There are l2cap and profile.
Let's look at this picture again , This picture is different again ,l2cap Below the floor is logical layer and physical layer.
Are you dizzy again ?
In fact, it's just from different angles , Previous architecture diagrams focused more on software protocols , The emphasis of this figure is on the physical link 、 A large number of abstract baseband concepts such as logical links .
Take a look at the following picture to make it clearer .

First of all physical channel.
The most basic condition of Bluetooth communication is that the receiving end and the sending end adjust the frequency to the same frequency band , The frequency band here is physics channel The concept of .
BR、EDR According to whether it supports adaptive frequency modulation basic piconet physical channel and adapted piconet physical channel.
Note that there are only two physical channel From the top physical link Of the connecting line , Why? page scan and inquiry scan There is no? , Because of the connection 、 Scanning these two conditions is a special state of Bluetooth , Use only at certain times , And can't control any properties , Basically host towards controller Next command , It enters this state , So it's not physical link In the embodiment .
Physical link It is an abstract concept , Does not correspond to any entity , For power 、 This layer is responsible for the management of the receipt / delivery cycle ,active、park Corresponding to different power consumption , The upper echelons don't have to know .
Logical The link layer corresponds to different packet formats , We have already talked about passing in chapter three packet header Medium llid To distinguish between acl-c and acl-u The situation of the . Of course, this is only the corresponding figure br/edr acl This link , There are many other links , The basic rule is , Always end with “c” All are control links , such as amp-c、acl-c、le-c wait , Always end with “u” All of them are upper level profile data , such as acl-u、psb-u、le-u wait .
All links , Have corresponding formats , Each format has a corresponding logical transport Layer provides services for it , Including flow control with different formats 、 Retransmission mechanism, etc .
Come to a knowledge point : The difference between logical link and logical channel ——
Many people like to talk about logical links , In fact, it mainly talks about the above controller The concept of layers , But the logical channel , Generally speaking , It's about l2cap Open to the upper layer cid. These are two concepts .
All of these , stay core spec Of controller This is explained in detail in the chapter , Some concepts are abstract , Not easy to understand .
Controller The structure of the protocol stack is relatively simple , Namely LMP and LC Two layers of ,LMP Namely link manager protocol,LC Namely link controller, Because this is usually something inside the Bluetooth module , So the reader may not know much , But understand the specific functions , It's necessary .
Let's take a look at this picture

Than the previous one host The diagram of protocol stack is much simpler, isn't it ?
In fact, it is not simple , There are a lot of things to say about segmentation .
stay HCI Layer the following , First of all LMP,LMP The function of link management is just as the name suggests , All the above physical link、logical link、logical transport All are LMP To manage .
LMP Upward bearing HOST Protocol stack , Receive from HOST Of hci command, You can manage LINK controller And baseband , Send to a remote Bluetooth device LMP pdu( We mentioned above ACL-C Do you remember Bao ? Namely LMP package ), Realize link connection 、 Control and maintenance .
Old rules , Let's take a look at our bags , See what happens during the connection process .
First , our host towards controller Sent the chain building Command

Look at Bluetooth core spec Map in , That's true :

Host After giving the order, I put it down , The rest is LMP Doing it , Look at the air bag ,LMP First, exchange with the remote device feature, See what each other supports , Then sent a LMP host connection request To the opposite end . Take a look at the parts marked in red below , We mentioned earlier LMP Down is the control LC Of ,LC Filled this LMP The head of the bag , Baotou contains flow control 、ARQ、 Package format and other information , The package format here is DM1,ARQN It's a ACK sign , It means this LMP The package needs a reply ; then payload header in LLID It indicates that this package is a ACL-C package , That is to say LMP package .

The remote end receives LMP After package , Will send to host Upload a request to connect event, from host To determine whether to accept the connection , If accepted , It is the following flow chart , We did receive it this time LMP accepted package , Indicates that the connection was successful .

This is the time , One acl The logical link has been established , Bluetooth protocol provisions , There can only be one between two devices acl Linked . however sco There can be several links .
Sco It is mainly used for hands-free calls , In a fixed time slot (reserved slots) send out , It mainly ensures the synchronization of communication , Not sure , Data lost is lost .
Take a look at building sco Flow chart of the link :

The same is host Give orders ,lmp perform , No more details , It's quite clear .
Link controller The function of will be closer to the bottom .
in general , It is based on the current physical link status , Run a state machine , Execute this status (page?inquiry?connection?park?) Tasks that must be performed , FM transceiver on different physical channels page package 、inquiry Packets or other data packets, etc , perform piconet Switch 、 Master-slave switchover and other work that directly deals with the hardware at the bottom .
The header of each Bluetooth packet is LC Of map, Among them ARQ、FLOW These bits are link controller Plus , it is to be noted that , Bluetooth only ID There is no bag packet header Of .
边栏推荐
- LabVIEW pictures look bright or dark after being cast from 16 bits to 8 bits
- Lambda 学习记录
- [pyGame collection] please check the game guide through childhood: are there any games you have played? (attach five source codes for self access)
- 【Pygame小游戏】别找了,休闲游戏专题来了丨泡泡龙小程序——休闲游戏研发推荐
- Binary tree pruning
- 选择排序
- LabVIEW open other exe programs
- Shell Sort
- 关于优化API接口响应速度
- [pyGame games] here it is. This Gobang game is super A. share it with your friends~
猜你喜欢

What is the workflow of dry goods MapReduce?

【Pygame小游戏】别找了,休闲游戏专题来了丨泡泡龙小程序——休闲游戏研发推荐

【Pygame小游戏】趣味益智游戏 :打地鼠,看一下能打多少只呢?(附源码)

B 树的简单认识

【Turtle表白合集】“海底月是天上月,眼前人是心上人。”余生多喜乐,长平安~(附3款源码)

LabVIEW open other exe programs

Leetcode-713 subarray with product less than k
![[MVC&Core]ASP.NET Core MVC 视图传值入门](/img/c2/3e69cda2fed396505b5aa5888b9e5f.png)
[MVC&Core]ASP.NET Core MVC 视图传值入门

Several common current transformer sampling circuits
![[AI card player] for the first time to see such an](/img/7b/f1965a74733e152dcc542e465112b0.png)
[AI card player] for the first time to see such an "exciting" landowner, the key factor for a high winning rate is
随机推荐
LabVIEW change the shape or color of point ROI overlay
In the month of safety production, Huangpu launched a publicity campaign for gas safety in shops
插入排序
[MVC&Core]ASP.NET Core MVC 视图传值入门
How to check the variable waveform when debugging the program? Look here
关于优化API接口响应速度
csdn每日一练——有序表的折半查找
[auto reply or remind assistant] Mom doesn't have to worry about me missing messages any more (10 Line Code Series)
快速排序
High speed data stream disk for LabVIEW
[pyGame games] here it is. This Gobang game is super A. share it with your friends~
How to remove the blank at the top of listview
【Pygame小游戏】“史上最炫酷贪吃蛇”驾到,FUN开玩(不好玩不要钱)
Website online customer service system Gofly source code development log - 5 Gin framework integration daemon
Self made app connected to onenet --- realize data monitoring and distribution control (mqtt)
Chapter 2 application layer 2.4 DNS
IGBT and third generation semiconductor SiC double pulse test scheme
[pyGame] can the little dinosaur on chrome be played with code? It looks like fun~
A simple understanding of B tree
LabVIEW uses the visa read function to read USB interrupt data