Bluetooth flow control

Bluetooth flow controlBaseband4.5.3FlowcontrolSincetheRXACLbuffercanbefullwhileanewpayloadarrives,flowcontrolisrequired.TheheaderfieldFLOWinthereturnTXpacketmayuseSTOPorGOinorderto…

大家好,又见面了,我是你们的朋友全栈君。

Baseband

4.5.3 Flow control
Since the RX ACL buffer can be full while a new payload arrives, flow control is 
required. The header field FLOW in the return TX packet may use STOP or GO 
in order to control the transmission of new data.

4.5.3.1 Destination control
As long as data can not be received, a STOP indication shall be transmitted 
which is automatically inserted by the Link Controller into the header of the 
return packet. STOP shall be returned as long as the RX ACL buffer is not 
emptied by the Baseband Resource Manager. When new data can be 
accepted again, the GO indication shall be returned. GO shall be the default 
value. All packet types not including data can still be received. Voice communication for example is not affected by the flow control. Although a device can not 
receive new information, it may still continue to transmit information: the flow 
control shall be separate for each direction.
4.5.3.2 Source control
On the reception of a STOP signal, the Link Controller shall automatically 
switch to the default packet type. The ACL packet transmitted just before the 
reception of the STOP indication shall be kept until a GO signal is received. It 
may be retransmitted as soon as a GO indication is received. Only default 
packets shall be sent as long as the STOP indication is received. When no 
packet is received, GO shall be assumed implicitly. Note that the default packets contain link control information (in the header) for the receive direction 
(which may still be open) and may contain synchronous data (HV or EV packets). When a GO indication is received, the Link Controller may resume transmitting the data that is present in the TX ACL buffers.
In a multi-slave configuration, only the transmission to the slave that issued the 
STOP signal shall be stalled. This means that the master shall only stop transmission from the TX ACL buffer corresponding to the slave that momentarily 
cannot accept data.

The header contains link control (LC) information and consists of 6 fields: 
• LT_ADDR: 3-bit logical transport address 
• TYPE: 4-bit type code 
• FLOW: 1-bit flow control 
• ARQN: 1-bit acknowledge indication 
• SEQN: 1-bit sequence number 
• HEC: 8-bit header error check 
The total header, including the HEC, consists of 18 bits, see Figure 6.8 on page 
109, and is encoded with a rate 1/3 FEC (not shown but described in Section 
7.4 on page 134) resulting in a 54-bit header. The LT_ADDR and TYPE fields 
shall be sent LSB first.
 

Bluetooth flow control

 

6.4.3 FLOW

The FLOW bit is used for flow control of packets over the ACL logical transport.

When the RX buffer for the ACL logical transport in the recipient is full, a STOP

indication (FLOW=0) shall be returned to stop the other device from transmit

ting data temporarily. The STOP signal only affects ACL packets. Packets

including only link control information (ID, POLL, and NULL packets), SCO

packets or eSCO packets can still be received. When the RX buffer can accept

data, a GO indication (FLOW=1) shall be returned. When no packet is

received, or the received header is in error, a GO shall be assumed implicitly. In

this case, the slave can receive a new packet with CRC although its RX buffer

is still not emptied. The slave shall then return a NAK in response to this packet

even if the packet passed the CRC check.

The FLOW bit is not used on the eSCO logical transport or the ACL-C logical

link and shall be set to one on transmission and ignored upon receipt.

 

HCI flow control

 

4.1 HOST TO CONTROLLER DATA FLOW CONTROL

On initialization, the Host shall issue the Read Buffer Size command. Two of

the return parameters of this command determine the maximum size of HCI

ACL and synchronous Data Packets (excluding header) sent from the Host to

the Controller. There are also two additional return parameters that specify the

total number of HCI ACL and synchronous Data Packets that the Controller

may have waiting for transmission in its buffers.

When there is at least one connection to another device, or when in local loop

back mode, the Controller shall use the Number Of Completed Packets event

to control the flow of data from the Host. This event contains a list of Connec

tion Handles and a corresponding number of HCI Data Packets that have been

completed (transmitted, flushed, or looped back to the Host) since the previous

time the event was returned (or since the connection was established, if the

event has not been returned before for a particular Connection Handle).

Based on the information returned in this event, and the return parameters of

the Read Buffer Size command that specify the total number of HCI ACL and

synchronous Data Packets that can be stored in the Controller, the Host

decides for which Connection Handles the following HCI Data Packets should

be sent.

Every time it has sent an HCI Data Packet, the Host shall assume that the free

buffer space for the corresponding link type (ACL, SCO or eSCO) in the Con

troller has decreased by one HCI Data Packet.

Each Number Of Completed Packets event received by the Host provides

information about how many HCI Data Packets have been completed (trans

mitted or flushed) for each Connection Handle since the previous Number Of

Completed Packets event was sent to the Host. It can then calculate the actual

current buffer usage.

When the Controller has completed one or more HCI Data Packet(s) it shall

send a Number Of Completed Packets event to the Host, until it finally reports

that all the pending HCI Data Packets have been completed. The frequency at

which this event is sent is manufacturer specific.

Note: The Number Of Completed Packets events will not report on synchro

nous Connection Handles if Synchronous Flow Control is disabled. (See Read/

26 July 2007 HCI Flow ControlBLUETOOTH SPECIFICATION Version 2.1 + EDR [vol 2] page 387 of 906

Host Controller Interface Functional Specification

Write Synchronous Flow Control Enable, Section 7.3.36 on page 544 and Sec

tion 7.3.37 on page 545)

For each individual Connection Handle, the data must be sent to the Controller

in HCI Data Packets in the order in which it was created in the Host. The Con

troller shall also transmit data on the air that is received from the Host for a

given Connection Handle in the same order as it is received from the Host.

Data that is received on the air from another device shall, for the corresponding

Connection Handle, be sent in HCI Data Packets to the Host in the same order

as it is received. This means the scheduling shall be decided separately for

each Connection Handle basis. For each individual Connection Handle, the

order of the data shall not be changed from the order in which the data has

been created.

 

4.2 CONTROLLER TO HOST DATA FLOW CONTROL

In some implementations, flow control may also be necessary in the direction

from the Controller to the Host. The Set Host Controller To Host Flow Control

command can be used to turn flow control on or off in that direction.

On initialization, the Host uses the Host Buffer Size command to notify the

Controller about the maximum size of HCI ACL and synchronous Data Packets

sent from the Controller to the Host. The command also contains two additional

command parameters to notify the Controller about the total number of ACL

and synchronous Data Packets that can be stored in the data buffers of the

Host.

The Host uses the Host Number Of Completed Packets command in exactly

the same way as the Controller uses the Number Of Completed Packets event

as was previously described in this section.

The Host Number Of Completed Packets command is a special command for

which no command flow control is used, and which can be sent anytime there

is a connection or when in local loopback mode. The command also has no

event after the command has completed. This makes it possible for the flow

control to work in exactly the same way in both directions, and the flow of nor

mal commands will not be disturbed.

 

7.3.37 Write Synchronous Flow Control Enable Command

HCI_Write_Synchronous_ Flow_Control_Enable   0x002F

The Write_Synchronous_Flow_Control_Enable command provides the ability  to write the Synchronous_Flow_Control_Enable setting. See Section 6.21 on  page 408.

Note: the Synchronous_Flow_Control_Enable setting can only be changed if  no connections exist.

 

 

7.3.38 Set Controller To Host Flow Control Command

 

HCI_Set_Controller_To_ Host_Flow_Control

0x0031 Flow_Control_Enable   Status

 

This command is used by the Host to turn flow control on or off for data and/or

voice sent in the direction from the Controller to the Host. If flow control is turned

off, the Host should not send the Host_Number_Of_Completed_Packets command.

 

L2CAP flow control

Assuming that the TxWindow size is equal to the buffer space available in the  receiver (counted in number of I-frames), in flow control mode the number of unacknowledged frames in the transmitter window is always less than or equal to the number of frames for which space is available in the receiver. 

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/135026.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 电脑开机显示“DISK Boot Failure,Insert System Disk And Press Enter”

    电脑开机显示“DISK Boot Failure,Insert System Disk And Press Enter” 电脑开机自检时无法通过,并在界面出现“DISKBootFailure,InsertSystemDiskAndPressEnter”的错误提示。这样的问题该如何解决?今天小编教大家如何排除故障。 造成电脑开机,屏幕上出现“DISKBootFailure,InsertSystemDiskAndPressEnter”故障的原因有: (1)由于硬盘,光驱连在同一条数据线上,但…

    2022年7月13日
    56
  • DHCP协议解析

    DHCP协议解析DHCP(DynamicHostConfigurationProtocol,动态主机配置协议)是IETF为实现IP的自动配置而设计的协议,它可以为客户机自动分配IP地址、子网掩码以及缺省网关、DNS服务器的IP地址等TCP/IP参数。了解DHCP工作过程可以帮助我们排除有关DHCP服务遇到的问题。DHCP协议是基于UDP层之上的应用,本文结合抓报所得数据分析DHCP协议实现原理一、

    2022年5月23日
    49
  • bWAPP靶场实战[通俗易懂]

    bWAPP靶场实战[通俗易懂]文章目录一、靶场介绍二、靶场搭建2.1安装类型2.2独立安装三、漏洞实战SSRF远程文件包含端口扫描一、靶场介绍  集成了超过100余个网络漏洞,phpweb漏洞靶场,能够调制漏洞难度等级(低->中->高)。二、靶场搭建下载:https://sourceforge.net/projects/bwapp/2.1安装类型搭建类型有两种:(虚拟机版本可测试测漏洞类型更多,比如破壳、心脏滴血)独立安装(部署到apache+php+mysql环境下)虚拟机安装(bee

    2022年9月16日
    6
  • ubuntu linux下开启远程唤醒

    ubuntu linux下开启远程唤醒目录启动远程唤醒,需要主板支持才能进行。步骤一:检查计算机硬件是否支持WOL(wakeonlan)功能。步骤二:检查主板和电源是否支持WOL步骤三:检查网卡是否支持WOL步骤四:查看网卡步骤五:查询网卡是否支持远程唤醒步骤六:开启远程唤醒d为关闭g为开启步骤七:参考操作启动远程唤醒,需要主板支持才能进行。步骤一:检查计算机硬件是否支持WOL(wakeonlan)功能。步骤二:检查主板和电源是否支持WOL进入BIOS的PowerManage…

    2022年5月12日
    50
  • python语言func_python中func什么意思[通俗易懂]

    python语言func_python中func什么意思[通俗易懂]python中的func表示自定义的函数,func只是一个函数名,它的名字不是固定不变的,自定义的函数的参数包括无参数,也可以根据函数动能传递必备参数、位置参数以及关键字参数等。小白在学习python的时候,都会遇到func,一脸蒙!是什么意思呢?在python中,func表示的自定义函数。python中的函数分为内置函数和自定义函数,内置函数是python本身自带的,func函数是人为定义的。f…

    2025年7月13日
    1
  • 使用sp_executesql存储过程执行动态SQL查询

    使用sp_executesql存储过程执行动态SQL查询Thesp_executesqlstoredprocedureisusedtoexecutedynamicSQLqueriesinSQLServer.AdynamicSQLqueryisaqueryinstringformat.ThereareseveralscenarioswhereyouhaveanSQLq…

    2022年5月21日
    31

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号