蓝牙的AVDTP协议笔记

摘要:
StreamEndPoint:应用程序通过此接口提供TransportService和AVcapability,以建立流。StreamHandle:主要用于程序使用。传输会话:流可以分解为多个传输会话。每个传输会话对应于数据包类别,即AVDTP的媒体、恢复或报告数据包。当不使用AVDTPMultiplexingMode时,一个传输信道只传输一个传输会话;使用传输会话时,一个传输通道可以传输多个传输会话。TransportChannelIdentifier:标识与L2CAPchannel唯一关联的TransportChannel。StreamReconfigurate:配置流。

1.概述

   AVDTP(AUDIO/VIDEO DISTRIBUTION TRANSPORT PROTOCOL)是用来描述音频/视频在蓝牙设备间的传输的协议,是A2DP协议的基础协议,其在协议栈中的位置如下:
蓝牙的AVDTP协议笔记
AVDTP协议建立在connection-oriented L2CAP channel上,只能支持point-to-point signaling。
 
2.一些术语
Stream:represents the logical end-to-end connection of streaming media data (audio or video) between two A/V devices.
Media Packets, Recovery Packets, and Reporting Packets:根据三种不同的数据类型,有这三种数据包。其中,Basic Service会用到Basic service,Report service会用到Reporting Packets,Recovery service会用到Recovery Packets,此外Multiplexing service会用到Media Packets和其余一种或两种Packet。
Stream End Point (SEP):应用程序通过这个接口提供Transport Services and AV capabilities来建立Stream。【是否可以参考网络编程中的端口号??】
Stream Context (SC):两端设备都有的关于Stream的信息。
Stream Handle (SH):主要是暴露给用于程序使用的。【可理解为文件操作的handle吧??】
Stream End Point Identifier (SEID):标识Stream End Point的。
Transport Session:一条stream可以分解为多个transport sessions,每个transport session对应一个AVDTP的packet category ,which means Media, Recovery, or Reporting packets。 
Transport Session Identifier (TSID):标识Transport Session。
Transport Channel:通常和一个L2CAP Channel对应。不用AVDTP Multiplexing Mode时,一条Transport Channel只传输一个transport session;用transport session的情况下,一条Transport  Channel可以传输多个transport session(media,report或者recovery)。
Transport Channel Identifier (TCID):标识Transport Channel,唯一关联一条L2CAP channel。
 
3.Signaling Procedures
    一个典型的Stream End-point Discovery to Stream Release过程:
蓝牙的AVDTP协议笔记
State Machine如下,共有5个状态:
蓝牙的AVDTP协议笔记
一些主要的procedure如下:
Stream End Point Discovery:远端设备提供支持的SEP列表和media Type。
Get All Capabilities:Using the SEID as a reference, the local device can query the service capabilities of the remote SEP。
Stream Configuration:By referencing both the local and the remote SEID, the local device (the INT) configures the SEP of the remote device (the ACP)。
Stream Get Configuration:etrieve the last capabilities settings performed by the remote device on the SEP。
Stream Establishment:The opening of a transport session, while referencing the remote SEID, includes, if necessary, the establishment of a new Transport Channel。
Stream Start:After the Stream Establishment is complete, the Start Streaming procedure causes the streaming to start; i.e., Media (Reporting, Recovery) packets can be exchanged。
Stream Release:initiated by the upper layer within a device; a signal is sent indicating
that a stream end-point be closed.
Stream Suspend:挂起。
Stream Reconfigure:对Stream进行配置。
Stream Reconfigure:再次配置。
Security Control:对AV data transmitted over a Bluetooth 提供protection。
Abort:用于两个设备的同步。
General Reject:对包含invalid Signal Identifier的Command进行的response。
Delay Reporting:provide an initial delay report required for synchronized audio/video playback。
 
4.Transport Procedures
    分为三种Service:Basic Service,Reporting Service,Recovery Service和Multiplexing Service。
Basic Service只提供signaling 和media streaming。Media Packet Format如下图:
蓝牙的AVDTP协议笔记
参数定义如下:
蓝牙的AVDTP协议笔记

蓝牙的AVDTP协议笔记

Reporting packet格式如下:
蓝牙的AVDTP协议笔记
注意:如果不使用multiplexing mode ,一个PDU包含一个meida或者reporting或者recovery packet
每个transport session 使用不同的L2CAP Channel。如果使用Multiplexing Service,则一个transport channel上可能有好几种transport transport,需要AL header 来进行区分。
蓝牙的AVDTP协议笔记

4.signaling message
一个Signal Fragmentation的实例:
蓝牙的AVDTP协议笔记
Signal command and response headers:
蓝牙的AVDTP协议笔记
参数Packet Type:
蓝牙的AVDTP协议笔记
参数Message Type:
蓝牙的AVDTP协议笔记

免责声明:文章转载自《蓝牙的AVDTP协议笔记》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇解决win10连接wifi,提示需要执行操作,并自动打开微软网站的问题textarea聚焦的多种写法下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Android双系统实现

1. 前言: 刷机,似乎是安卓手机用户的一项专利,可是,会刷机的用户一般都是喜新厌旧的角色。 一个系统用久了。就想换到还有一个系统。或者认为没有原来的好,或者又认为要换回去。这样又要重刷。 可是刷来刷去都麻烦啊,而且每次刷机也不是没有风险的,一不小心就可能造成关键数据的丢失。 没有解决的方法吗? 有。双系统! 甚至三系统,四系统! ! 本文就是解决问题的,...

小米手机卡刷

一.解锁手机BL锁 目前手机刷机需要解锁手机bl锁,这里以小米手机为例:小米解锁页面:http://www.miui.com/unlock/download.html手机需进入开发者模式,并在"设备解锁状态"中绑定账号和设备。随后手机进入Bootloader模式(长按电源键和音量-) 二.刷入recovery 这里使用奇兔的recovery,方便快捷奇兔官...

zabbix监控华为交换机

1、交换机启动SNMP Agent服务 system-view //进入系统视图 snmp-agent //启动SNMP Agent服务 snmp-agent local-engineid [engineid] //配置本地SNMP实体的引擎ID snmp-agent sys-info v...

VMware Data Recovery备份恢复vmware虚拟机

VMware Data Recovery 是VMware虚拟机备份工具,可创建虚拟机备份,同时不会中断虚拟机的使用或虚拟机提供的数据和服务。Data Recovery 管理现有备份,并在这些备份过时后将其删除。它还支持删除重复以删除冗余数据。 1.1 系统需求 在安装 VMware Data Recovery 之前,请确保环境中的系统和存储可用。 VMwa...

尝鲜党:Nexus5、6刷安卓M教程

说明:   进入recovery的命令:adb reboot recovery        进入bootloader的命令:adb reboot bootloader 概述 F:Nexus5AndroidMhammerhead-MPZ44Q>fastboot flash bootloader bootloader bootlo ader-hamm...

recovery模式差分(增量)升级小结

最近在做recovery模式下的升级,简单的总结一下。 先说说recovery模式,他是个升级小系统,有单独的kernel,通过特定的系统命令就可以进入到此系统中,选择进入正常系统的kernel还是recovery系统的kernel, 决定在于bootloader中,recovery中的boot与正常系统的boot烧写的是相同的kernel,不同点在于,r...