当前位置:网站首页>Ble HCI flow control mechanism
Ble HCI flow control mechanism
2022-07-04 17:18:00 【Millennium fate】
HCI There are two flow control mechanisms
- packet-based - Control the sending and receiving based on the number of packets
- data-block-based - Control the sending and receiving based on the data length
BR/EDR By default packet-based, You can use HCI_Write_Flow_Control_Mode command Set up , and BLE Only support packet-based
One 、Host to Controller data flow control
At the beginning ,Host adopt HCI_LE_Read_Buffer_Size Command acquisition Controller Each of them ACL buffer Size , as well as ACL buffer The number of , This number is allowed Host towards Controller Continuous transmission ACL Number of bags
When Host towards Controller Send a ACL After package , The number of contract awarding is allowed to be reduced 1, When the number of contracts allowed is 0 when , Can't go to Controller send out
When Controller Deal with one ACL After package , If the data has been sent to the peer device ,Controller Release ACL buffer Space , And to Host send out HCI_Number_Of_Completed_Packets event, At this time, it is allowed to add 1,Host You can continue to Controller Sent
If Controller Handle multiple at the same time ACL package ,Controller Release multiple ACL buffer Space ,HCI_Number_Of_Completed_Packets event There will be multiple connections released in ACL buffer Number , At this time, the increment of the number of contracts is allowed to be released for all connections ACL buffer The sum of the numbers 
Two 、Controller to Host data flow control
Controller towards Host The flow control of the direction is off by default , Can pass HCI_Set_Controller_To_Host_Flow_Control cmd Turn on or off 
Mechanism and Host to Controller be similar , At the beginning ,Host adopt HCI_Host_Buffer_Size cmd inform Controller Own each ACL buffer Size , as well as ACL buffer The number of , This number is allowed Controller towards Host Continuous transmission ACL Number of bags

When Controller towards Host Send a ACL After package , The number of contract awarding is allowed to be reduced 1, When the number of contracts allowed is 0 when , Can't go to Host send out
When Host Deal with one ACL After package , If the data has been sent to the upper layer for processing ,Host Release ACL buffer Space , And to Controller send out HCI_Host_Number_Of_Completed_Packets command, At this time, it is allowed to add 1,Controller You can continue to Host Sent
If Host Handle multiple at the same time ACL package ,Host Release multiple ACL buffer Space ,HCI_Host_Number_Of_Completed_Packets command There will be multiple connections released in ACL buffer Number , At this time, the increment of the number of contracts is allowed to be released for all connections ACL buffer The sum of the numbers
HCI_Host_Number_Of_Completed_Packets cmd It's a special one cmd, It is not controlled by flow control ,Host Can at any time to Controller send out , And there is no corresponding event Generate 
3、 ... and 、command flow control
When Host towards Controller send out command after ,Controller Will send to Host return HCI_Command_Complete event or HCI_Command_Status event, these two items. event There are parameters in num_of_allowed_command_packet, This parameter is Host Can be directed to Controller Continuous transmission command The number of
At the beginning or at any subsequent time ,Controller Can be directed to Host send out Command Opcode=0x0000 Of HCI_Command_Status event or HCI_Command_Status event, To inform Host Continuous transmission is allowed at this time command The number of 

边栏推荐
- C# 更加优质的操作MongoDB数据库
- Solution du système de gestion de la chaîne d'approvisionnement du parc logistique intelligent
- Years of training, towards Kata 3.0! Enter the safe container experience out of the box | dragon lizard Technology
- 第十八届IET交直流输电国际会议(ACDC2022)于线上成功举办
- 基于check-point机制的任务状态回滚和数据分块任务
- 智慧物流园区供应链管理系统解决方案:数智化供应链赋能物流运输行业供应链新模式
- Use and principle of thread pool
- 世界环境日 | 周大福用心服务推动减碳环保
- go-micro教程 — 第二章 go-micro v3 使用Gin、Etcd
- Implement graph data construction task based on check point
猜你喜欢

leetcode:421. The maximum XOR value of two numbers in the array

祝贺Artefact首席数据科学家张鹏飞先生荣获 Campaign Asia Tech MVP 2022

照明行业S2B2B解决方案:高效赋能产业供应链,提升企业经济效益

容器环境minor gc异常频繁分析

Understand ThreadLocal in one picture

电子元器件B2B商城系统开发:赋能企业构建进销存标准化流程实例

How to choose one plus 10 pro and iPhone 13?

Congratulations to Mr. Zhang Pengfei, chief data scientist of artefact, for winning the campaign Asia tech MVP 2022

It's too convenient. You can complete the code release and approval by nailing it!

聊聊异步编程的 7 种实现方式
随机推荐
Blood spitting finishing nanny level series tutorial - play Fiddler bag grabbing tutorial (2) - first meet fiddler, let you have a rational understanding
Understand ThreadLocal in one picture
APOC自定义函数和过程
基于check-point机制的任务状态回滚和数据分块任务
Oracle监听器Server端与Client端配置实例
The winning rate against people is 84%, and deepmind AI has reached the level of human experts in army chess for the first time
Position encoding practice in transformer
智慧物流园区供应链管理系统解决方案:数智化供应链赋能物流运输行业供应链新模式
表单传递时,如何隐式将值传过去
中银证券网上开户安全吗?
How can programmers improve the speed of code writing?
js中的数组筛选fliter
Go语言循环语句(第10课下)
Overflow: the combination of auto and Felx
The 18th IET AC / DC transmission International Conference (acdc2022) was successfully held online
Difference between redis' memory obsolescence strategy and expiration deletion strategy
昆明三环闭合工程将经过这些地方,有在你家附近的吗?
TP configuring multiple databases
Sql实现Split
Redis 的内存淘汰策略和过期删除策略的区别