AVDTP协议分析(一)--转--

AVDTP协议分析(一)

1.概述

   AVDTP(AUDIO/VIDEODISTRIBUTION TRANSPORT PROTOCOL)是用来描述音频/视频在蓝牙设备间的传输的协议,是A2DP协议的基础协议,其在协议栈中的位置如下:


AVDTP协议建立在connection-oriented L2CAP channel上,只能支持point-to-pointsignaling。

2.一些术语

Stream:represents the logical end-to-endconnection of streaming media data (audio or video) between two A/V devices.
MediaPackets, Recovery Packets, and Reporting Packets:根据三种不同的数据类型,有这三种数据包。其中,Basic Service会用到Basicservice,Report service会用到ReportingPackets,Recovery service会用到RecoveryPackets,此外Multiplexing service会用到Media Packets和其余一种或两种Packet。
Stream EndPoint (SEP):应用程序通过这个接口提供TransportServices and AV capabilities来建立Stream。
StreamContext (SC):两端设备都有的关于Stream的信息。
Stream Handle(SH):主要是暴露给用于程序使用的。
Stream EndPoint Identifier (SEID):标识Stream End Point的。
TransportSession:一条stream可以分解为多个transportsessions,每个transport session对应一个AVDTP的packet category ,which means Media, Recovery, or Reporting packets。 
TransportSession Identifier (TSID):标识Transport Session。
TransportChannel:通常和一个L2CAP Channel对应。不用AVDTP Multiplexing Mode时,一条Transport Channel只传输一个transport session;用transport session的情况下,一条Transport  Channel可以传输多个transportsession(media,report或者recovery)。
TransportChannel Identifier (TCID):标识Transport Channel,唯一关联一条L2CAP channel。

3.Signaling Procedures

一个典型的Stream End-pointDiscovery to Stream Release过程:State Machine如下共有5个状态:


一些主要的procedure如下:
Stream End Point Discovery:远端设备提供支持的SEP列表和mediaType。
Get All Capabilities:Using the SEID as a reference, the local device can querythe service capabilities of the remote SEP。
Stream Configuration:By referencing both the local and the remote SEID, thelocal device (the INT) configures the SEP of the remote device (the ACP)。
Stream Get Configuration:etrieve the last capabilities settingsperformed by the remote device on the SEP。
Stream Establishment:The opening of a transport session, while referencingthe remote SEID, includes, if necessary, the establishment of a new TransportChannel。
Stream Start:After the Stream Establishment is complete, the Start Streamingprocedure 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 sentindicating
thata stream end-point be closed.
Stream Suspend:挂起。
Stream Reconfigure:对Stream进行配置。
StreamReconfigure:再次配置。
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 synchronizedaudio/video playback。
 

4.Transport Procedures

分为三种Service:Basic Service,Reporting Service,Recovery Service和Multiplexing Service。
Basic Service只提供signaling 和mediastreaming。Media Packet Format如下图:


参数定义如下:


Reporting packet格式如下:


注意:如果不使用multiplexing mode ,一个PDU包含一个meida或者reporting或者recovery packet
每个transport session 使用不同的L2CAPChannel。如果使用MultiplexingService,则一个transport channel上可能有好几种transport transport,需要AL header 来进行区分。
4.signaling message

一个SignalFragmentation的实例:


Signal command and response headers:


参数Packet Type:


参数Message Type:


原文;https://mp.weixin.qq.com/s/-7i-Feo7tpjbgCdiqPzo7Q

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值