1.概述
???AVDTP(AUDIO/VIDEO DISTRIBUTION TRANSPORT PROTOCOL)是用來描述音頻/視頻在藍牙設備間的傳輸的協議,是A2DP協議的基礎協議,其在協議棧中的位置如下:
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過程:
State Machine如下,共有5個狀態:
一些主要的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如下圖:
參數定義如下:
Reporting packet格式如下:
注意:如果不使用multiplexing mode ,一個PDU包含一個meida或者reporting或者recovery packet
每個transport session 使用不同的L2CAP Channel。如果使用Multiplexing Service,則一個transport channel上可能有好幾種transport transport,需要AL header 來進行區分。
4.signaling message
一個Signal Fragmentation的實例:
Signal command and response headers:
參數Packet Type:
參數Message Type: