当前位置: 首页 > news >正文

【蓝牙协议栈】【BR/EDR】【AVCTP】精讲音视频控制传输协议

1.欢迎大家关注和订阅匠心之作【精讲蓝牙协议栈】【精讲BLE协议栈】【Android Bluetooth Stack】专栏会持续更新中.....敬请期待!

2. 精讲蓝牙协议栈(Bluetooth Stack):SPP/A2DP/AVRCP/HFP/PBAP/IAP2/HID/MAP/OPP/PAN/GATTC/GATTS/HOGP等协议理论

目录

1.AVCTP 概念

2.AVCTP 封包格式

2.1 没有被分隔的 AVCTP  

2.2 被分隔的 AVCTP


1.AVCTP 概念

AVCTP(Audio/Video Control Transport Protocol)协议描述了蓝牙设备间 Audio/Video 的控制信号交换的格式和机制,它是一个总体的协议,具体的控制 信息由其指定的协议(如 AVRCP)实现,AVCTP 本身只指定控制 command 和 response 的总体的格式。

几个重要的点:

(1)AVCTP uses point-to-point signaling over connection-oriented L2CAP channels.

(2)AVCTP shall be able to support both controller and target functionalities at both sides of the connection.

(3)Between two devices, multiple AVCTP connections may exist. Each AVCTP connection has its own L2CAP channel with its unique PSM value. There shall be only one AVCTP connection per PSM per ACL.

(4)Each AVCTP packet shall be transported on a single L2CAP packet.

(5)不同 L2CAP channel 上的相同的 transaction Label 是属于不同的 message 的。也就是说,两条 L2CAP 上的 packets 是没有关系的,不可能属于同一个 message。AVCTP 整个框架如下:

以上图示我继续做了细化,在整个协议栈的结构如红框:

 可以看到 AVCTP 是基于 L2CAP 协议的,他有两组 PSM,分别如下:

2.AVCTP 封包格式

AVCTP 封包格式分为两种: 

  • 没有被分隔的(小于 L2CAP MTU)
  • 被分隔的(大于 L2CAP MTU) 下面我们来分别介绍下每种的格式:

2.1 没有被分隔的 AVCTP  

Transaction label field: (octet 0, bits 7-4) value is provided by the application.传输标示,由上层提供

Packet_type field:(octet 0, bits 3 and 2) is set to zero to indicate that the command/response message is transmitted in a single L2CAP packet. 

此部分 00b 标示没有被分割.

C/R: (octet 0, bit 1) indicates whether the message conveys a command frame (0) or a response frame (1). It is provided by the application.0 代表 command,1 代表 response

IPID :bit (octet 0, bit 0) is set in a response message to indicate an invalid profile identifier received in the command message of the same transaction; otherwise this bit is set to zero. In command messages this bit is set to zero.在 command 中设置为 0,在 response 中设置为 0 代表正常

PID Profile Identifier (PID): field indicates that the command/response frame is coded according to the rules defined by the identified profile. The value shall be identical to the bits UUID of the service class,此 部分填写 16bit 的 UUID,比如 AVRCP 的 UUID 0x110e 后续的 Message Infomation 就是上层协议的数据

2.2 被分隔的 AVCTP

被分隔的的数据包格式一共有三种  

 我们在这里只介绍两个地方,其他跟没有被分隔的一致:

1)Packet_type:The Packet_Type field (see Section 6.1.2) qualifies each L2CAP packet as either first (Packet_Type=01), continue (Packet_Type=10), or end packet (Packet_Type=11). In the case of a nonfragmented message (see Section 6.1.1), this field (Packet_Type=00) simply indicates that the message fits into a single packet and the number of packets is not inserted in the message.

总结下:开始封包是 01b,继续封包 10b,结束封包是 11b

2)Number of AVCTP Packets is present in every start packet (octet 2 ) to indicate the total number of AVCTP packets that belong to the same message. As the start packet is also counted, this value is always greater than 1.

总结下:标示整个分隔封包的数量,包含这个开始封包,所以此封包的个数肯 定是大于 1 的。 示意图如下:

相关文章:

  • BUUCTF 大流量分析(一) 1
  • AUTOSAR图解==>AUTOSAR_SRS_CryptoStack
  • 从0开始学习大模型--Day01--大模型是什么
  • Linux 常用指令详解
  • tensorflow 调试
  • Lombok 是什么?
  • 014枚举之指针尺取——算法备赛
  • 【Linux网络#17】TCP全连接队列与tcpdump抓包
  • LeetCode 热题 100 78. 子集
  • 洛谷 P9007 [入门赛 #9] 最澄澈的空与海 (Hard Version)
  • N-Gram 模型
  • 基于Vue3开发:打造高性能个人博客与在线投票平台
  • Java---Object和内部类
  • 协程补充---viewModelScope 相关知识点
  • 蓝桥杯 19. 植树
  • 事务隔离(MySQL)
  • 5.4 - 5.5Web基础+c语言拓展功能函数
  • sqli-labs靶场11-17关(POST型)
  • 深度解析:从 GPT-4o“谄媚”到 Deepseek“物理腔”,透视大模型行为模式的底层逻辑与挑战
  • ns-3仿真_pcap抓取时间太长问题_log打印时间显示5s结束,pcap抓包抓到了10s
  • 五一小长假上海“人从众”,全要素旅游交易总额超200亿元
  • 两个灵魂,一支画笔,意大利艺术伴侣的上海灵感之旅
  • 视频丨054B型护卫舰钦州舰南海实战化训练
  • 酒店民宿一房难求,湖北宣恩文旅局工作人员腾出家中空房给游客救急
  • 一金两银一铜!中国田径从柯桥望向世界大赛
  • 马上评|提供情绪价值,也是文旅经济的软实力