summaryrefslogtreecommitdiff
path: root/monitor/avdtp.c
diff options
context:
space:
mode:
authorAndrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>2015-11-22 21:20:30 +0100
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-12-01 10:42:29 +0200
commitbe310fa80d842f9a2eb3e15942df7a37618a8b62 (patch)
tree094cdbbfb31a98eb793c0ecb1fb02748849a9d21 /monitor/avdtp.c
parent43194170956820076bfb543606fee3809a5011a8 (diff)
downloadbluez-be310fa80d842f9a2eb3e15942df7a37618a8b62.tar.gz
monitor/a2dp: Decode SBC capabilities
> ACL Data RX: Handle 256 flags 0x02 dlen 20 [hci0] 9.242155 Channel: 66 len 16 [PSM 25 mode 0] {chan 2} AVDTP: Get Capabilities (0x02) Response Accept (0x02) type 0x00 label 1 nosp 0 Service Category: Media Transport (0x01) Service Category: Media Codec (0x07) Media Type: Audio (0x00) Media Codec: SBC (0x00) Frequency: 0x30 44100 48000 Channel Mode: 0x0f Mono Dual Channel Stereo Joint Channel Block Length: 0xf0 4 8 12 16 Subbands: 0x0c 4 8 Allocation Method: 0x03 SNR Loudness Minimum Bitpool: 2 Maximum Bitpool: 53 Service Category: Content Protection (0x04) Content Protection Type: SCMS-T (0x0002) < ACL Data TX: Handle 256 flags 0x00 dlen 18 [hci0] 9.272120 Channel: 258 len 14 [PSM 25 mode 0] {chan 2} AVDTP: Set Configuration (0x03) Command (0x00) type 0x00 label 5 nosp 0 ACP SEID: 1 INT SEID: 3 Service Category: Media Transport (0x01) Service Category: Media Codec (0x07) Media Type: Audio (0x00) Media Codec: SBC (0x00) Frequency: 44100 (0x20) Channel Mode: Joint Channel (0x01) Block Length: 16 (0x10) Subbands: 8 (0x04) Allocation Method: Loudness (0x01) Minimum Bitpool: 2 Maximum Bitpool: 53
Diffstat (limited to 'monitor/avdtp.c')
-rw-r--r--monitor/avdtp.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/monitor/avdtp.c b/monitor/avdtp.c
index f810f0e68..3524faa04 100644
--- a/monitor/avdtp.c
+++ b/monitor/avdtp.c
@@ -37,6 +37,7 @@
#include "display.h"
#include "l2cap.h"
#include "avdtp.h"
+#include "a2dp.h"
/* Message Types */
#define AVDTP_MSG_TYPE_COMMAND 0x00
@@ -75,6 +76,13 @@ struct avdtp_frame {
struct l2cap_frame l2cap_frame;
};
+static inline bool is_configuration_sig_id(uint8_t sig_id)
+{
+ return (sig_id == AVDTP_SET_CONFIGURATION) ||
+ (sig_id == AVDTP_GET_CONFIGURATION) ||
+ (sig_id == AVDTP_RECONFIGURE);
+}
+
static const char *msgtype2str(uint8_t msgtype)
{
switch (msgtype) {
@@ -293,12 +301,10 @@ static bool service_media_codec(struct avdtp_frame *avdtp_frame, uint8_t losc)
print_field("%*cMedia Codec: %s (0x%02x)", 2, ' ',
mediacodec2str(codec), codec);
- /* TODO: decode codec specific information */
-
- packet_hexdump(frame->data, losc);
- l2cap_frame_pull(frame, frame, losc);
-
- return true;
+ if (is_configuration_sig_id(avdtp_frame->sig_id))
+ return a2dp_codec_cfg(codec, losc, frame);
+ else
+ return a2dp_codec_cap(codec, losc, frame);
}
static bool decode_capabilities(struct avdtp_frame *avdtp_frame)