当前位置:网站首页>Bluetooth (5) -- about retransmission

Bluetooth (5) -- about retransmission

2022-06-11 00:08:00 yuanyun_ elber

Finally, it comes to l2cap The layer .

L2CAP Features include agreement / Channel multiplexing , Regroup in sections (segmentation and reassembly, SAR), Flow control and error control of each channel

The channel here does not refer to the physical channel of different frequency bands , But to l2cap The layer is open to the upper application channel, The upper application is based on l2cap Layer of channel id To judge whether it belongs to you profile Of data Of .

Let's continue with the topic that we didn't finish last time .

In most cases , Yes hci Layer flow control is enough , But somehow l2cap It provides this service , It is always right for us to study .

L2cap The logical channel of can work in 5 In different modes ( It can be understood as 5 Different scenarios )

1、Basic L2CAP Mode(equivalent to L2CAP specification in Bluetooth v1.1) The default mode , When no other mode is selected , In this mode .
2、Flow Control Mode  In this mode, retransmission will not be performed , But missing data can be detected , And report loss .
3、Retransmission Mode  This mode ensures that all data packets can be successfully transmitted to the peer device .
4、Enhanced Retransmission Mode  This mode is similar to the retransmission mode , Joined the Poll-bit And so on .
5、Streaming Mode  This mode is for real-time transmission , Packets are numbered but do not need to ACK confirm . Set a timeout timer , Once the timer times out, the timeout data will be flushed .
6、LE Credit Based Flow Control Mode  Be used for LE Device communication .

Generally speaking , We work in the first mode , In this mode ,l2cap The layer has no flow control and retransmission .

The retransmission of Bluetooth is actually LC The floor already has , adopt ARQ, It's basically a question and answer form .

L2cap Layer retransmission should be discussed together with flow control , stay flow control mode and retransmission mode Next , There is a kind of s-frame Special package for , Which includes seq number Information about ( Be careful , stay lc Layer provides seq, Only 0 and 1 Two kinds of , because lc Layer of arq The mechanism is strictly a question and answer , therefore seq Only 0 and 1 That's enough )

L2cap The layers are a little different , You can set a tx window, After sending multiple packets continuously , Then ask the other party to answer , The benefit of this is the improvement of efficiency .

The following is the sequence diagram of retransmission mode :

The difference between flow control mode and retransmission mode is , No retransmission in flow control mode , But it will report packet loss .

Review flow control and retransmission :

Bluetooth retransmission and flow control in general LC Layers are fine cover,l2cap Although the layer provides related services , But it is seldom used in practical applications . about LC Layer , Retransmission based on ARQ Mechanism , Flow control depends on controller buffe, from LC Layer update packet header Medium flow position . in addition , For the local hci transport Interface , There are two types of flow control , One is hci command, adopt hci command complete event Flow control , General controller Only single command is supported ; Two is hci acl data, There are two directions of flow control , adopt hci read buffer size command,hci host buffer size command,hci host number of completed packets command,hci number of completed packets event Four orders 、 Event flow control .

原网站

版权声明
本文为[yuanyun_ elber]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203020629284453.html