1 #ifndef BLUETOOTH_AVDTP_H
2 #define BLUETOOTH_AVDTP_H
4 ** $VER: avdtp.h 1.0 (22.05.06)
6 ** Bluetooth Audio/Video Distribution Protocol (AVDTP) definitions include file
8 ** (C) Copyright 2006 Chris Hodges
17 #define AVDTP_DISCOVER 0x01
18 #define AVDTP_GET_CAPABILITIES 0x02
19 #define AVDTP_SET_CONFIGURATION 0x03
20 #define AVDTP_GET_CONFIGURATION 0x04
21 #define AVDTP_RECONFIGURE 0x05
22 #define AVDTP_OPEN 0x06
23 #define AVDTP_START 0x07
24 #define AVDTP_CLOSE 0x08
25 #define AVDTP_SUSPEND 0x09
26 #define AVDTP_ABORT 0x0a
27 #define AVDTP_SECURITY_CONTROL 0x0b
30 #define AVDTP_STATE_IDLE 0x00
31 #define AVDTP_STATE_CONFIGURED 0x01
32 #define AVDTP_STATE_OPEN 0x02
33 #define AVDTP_STATE_STREAMING 0x03
34 #define AVDTP_STATE_CLOSING 0x04
35 #define AVDTP_STATE_ABORTING 0x05
37 struct BTAVDTPMediaPkt
39 UBYTE avdtpm_Control
; /* Control field */
40 UBYTE avdtpm_MarkerPT
; /* Marker and PayloadType */
41 UWORD avdtpm_SeqNum
; /* Sequence number */
42 ULONG avdtpm_TimeStamp
; /* Time Stamp */
43 ULONG avdtpm_SSRC
; /* Random unique ID */
44 ULONG avdtpm_CSRS
[0]; /* Contributing sources */
47 /* Bits in control field */
48 #define AVDTP_CTRLM_VERSION 0xc0 /* Version */
49 #define AVDTP_CTRLS_VERSION 6
51 #define AVDTP_CTRLF_PADDING 0x20 /* Padding bytes */
52 #define AVDTP_CTRLF_EXTENSION 0x10 /* One extra header extension */
53 #define AVDTP_CTRLM_CSRC_CNT 0x0f /* Number of CSRCs to follow */
54 #define AVDTP_CTRLS_CSRC_CNT 0
56 /* Bits in MarkerPT field */
57 #define AVDTP_MPTF_MARKER 0x80 /* Marker */
58 #define AVDTP_MPTM_PAYLOAD_TYPE 0x7f /* Payload type */
59 #define AVDTP_MPTS_PAYLOAD_TYPE 0
62 struct BTAVDTPReportBlock
64 ULONG avdtpb_SSRC
; /* SSRC of source */
65 ULONG avdtpb_PacketsLost
; /* Packets lost (High byte: fraction lost) */
66 ULONG avdtpb_HighSeqNum
; /* Extended Highest Sequence Number Received */
67 ULONG avdtpb_Jitter
; /* Interval Jitter */
68 ULONG avdtpb_LastSR
; /* Last SR */
69 ULONG avdtpb_DelayLastSR
; /* Delay Since Last SR */
72 struct BTAVDTPSenderReportingPkt
74 UBYTE avdtpr_VPRC
; /* Version/Padding/Reception Count field */
75 UBYTE avdtpr_PT
; /* PacketType = 200 (RTCP_SR) */
76 UWORD avdtpr_Length
; /* Length in ULONGs in RTCP minus one (incl header) */
77 ULONG avdtpr_SenderSSRC
; /* SSRC of Sender */
78 ULONG avdtpr_NTPStampHigh
; /* NTP Time Stamp (MSW) */
79 ULONG avdtpr_NTPStampLow
; /* NTP Time Stamp (LSW) */
80 ULONG avdtpr_RTPStamp
; /* RTP Time Stamp */
81 ULONG avdtpr_TXPacketCnt
; /* Sender's Packet Count */
82 ULONG avdtpr_TXByteCnt
; /* Sender's Octet Count */
83 struct BTAVDTPReportBlock avdtpr_Blocks
[0]; /* Report blocks following */
86 struct BTAVDTPReceiverReportingPkt
88 UBYTE avdtpr_VPRC
; /* Version/Padding/Reception Count field */
89 UBYTE avdtpr_PT
; /* PacketType = 201 (RTCP_RR) */
90 UWORD avdtpr_Length
; /* Length in ULONGs in RTCP minus one (incl header) */
91 ULONG avdtpr_SenderSSRC
; /* SSRC of Sender */
92 struct BTAVDTPReportBlock avdtpr_Blocks
[0]; /* Report blocks following */
95 struct BTAVDTPSourceDescPkt
97 UBYTE avdtpr_VPSC
; /* Version/Padding/Source Count field */
98 UBYTE avdtpr_PT
; /* PacketType = 202 (RTCP_SDES) */
99 UWORD avdtpr_Length
; /* Length in ULONGs in RTCP minus one (incl header) */
100 ULONG avdtpr_Chunks
[0]; /* Chunks */
105 UBYTE avdtpc_Control
; /* Transaction label, packet type, message type */
106 UBYTE avdtpc_SignalID
; /* RFA and Signal Idenitifer */
107 UBYTE avdtpc_Param
[0]; /* More data fields */
110 /* Control field bits */
111 #define AVDTP_CMDM_TRANSLABEL 0xf0
112 #define AVDTP_CMDS_TRANSLABEL 4
114 #define AVDTP_CMDM_FRAGINFO 0x0c
115 #define AVDTP_CMDF_SINGLE 0x00
116 #define AVDTP_CMDF_START 0x04
117 #define AVDTP_CMDF_CONTINUE 0x08
118 #define AVDTP_CMDF_END 0x0c
120 #define AVDTP_CMDM_CMDRSP 0x03
121 #define AVDTP_CMDF_COMMAND 0x00
122 #define AVDTP_CMDF_ACCEPT 0x02
123 #define AVDTP_CMDF_REJECT 0x03
125 #define AVDTP_CMDM_SIGNALID 0x3f
126 #define AVDTP_CMDS_SIGNALID 0
128 /* Service Category information elements */
129 #define AVDTP_SC_MEDIA_TRANSPORT 0x01
130 #define AVDTP_SC_REPORTING 0x02
131 #define AVDTP_SC_RECOVERY 0x03
132 #define AVDTP_SC_CONTENT_PROTECTION 0x04
133 #define AVDTP_SC_HEADER_COMPRESSION 0x05
134 #define AVDTP_SC_MULTIPLEXING 0x06
135 #define AVDTP_SC_MEDIA_CODEC 0x07
138 #if defined(__GNUC__)
142 #endif /* BLUETOOTH_AVDTP_H */