From: Szymon Janc <szymon.janc@codecoup.pl>
To: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v2 22/22] monitor/a2dp: Decode LDAC capabilities
Date: Fri, 20 Nov 2015 17:40:09 +0100 [thread overview]
Message-ID: <1486854.e8g2EASchL@ix> (raw)
In-Reply-To: <1448028820-25330-23-git-send-email-andrzej.kaczmarek@codecoup.pl>
Hi Andrzej,
On Friday 20 November 2015 15:13:40 Andrzej Kaczmarek wrote:
> > ACL Data RX: Handle 12 flags 0x02 dlen 24
>
> Channel: 67 len 20 [PSM 25 mode 0] {chan 1}
> AVDTP: Get Capabilities (0x02) Response Accept (0x02) type 0x00 label
> 2 nosp 0 Service Category: Media Transport (0x01)
> Service Category: Media Codec (0x07)
> Media Type: Audio (0x00)
> Media Codec: Non-A2DP (0xff)
> Vendor ID: Sony Corporation (0x0000012d)
> Vendor Specific Codec ID: LDAC (0x00aa)
> Unknown: 0x073c
> Service Category: Content Protection (0x04)
> Content Protection Type: SCMS-T (0x0002)
>
> < ACL Data TX: Handle 12 flags 0x02 dlen 26
> Channel: 2753 len 22 [PSM 25 mode 0] {chan 1}
> AVDTP: Set Configuration (0x03) Command (0x00) type 0x00 label 5 nosp
> 0 ACP SEID: 5
> INT SEID: 3
> Service Category: Media Transport (0x01)
> Service Category: Media Codec (0x07)
> Media Type: Audio (0x00)
> Media Codec: Non-A2DP (0xff)
> Vendor ID: Sony Corporation (0x0000012d)
> Vendor Specific Codec ID: LDAC (0x00aa0
> Unknown: 0x0104
> Service Category: Content Protection (0x04)
> Content Protection Type: SCMS-T (0x0002)
> ---
> monitor/a2dp.c | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/monitor/a2dp.c b/monitor/a2dp.c
> index d438db0..2077d70 100644
> --- a/monitor/a2dp.c
> +++ b/monitor/a2dp.c
> @@ -50,6 +50,8 @@
> /* Vendor Specific A2DP Codecs */
> #define APTX_VENDOR_ID 0x0000004f
> #define APTX_CODEC_ID 0x0001
> +#define LDAC_VENDOR_ID 0x0000012d
> +#define LDAC_CODEC_ID 0x00aa
>
> struct bit_desc {
> uint8_t bit;
> @@ -212,6 +214,8 @@ static const char *vndcodec2str(uint32_t vendor_id,
> uint16_t codec_id) {
> if (vendor_id == APTX_VENDOR_ID && codec_id == APTX_CODEC_ID)
> return "aptX";
> + else if (vendor_id == LDAC_VENDOR_ID && codec_id == LDAC_CODEC_ID)
> + return "LDAC";
>
> return "Unknown";
> }
> @@ -503,6 +507,20 @@ static bool codec_vendor_aptx_cap(uint8_t losc, struct
> l2cap_frame *frame) return true;
> }
>
> +static bool codec_vendor_ldac(uint8_t losc, struct l2cap_frame *frame)
> +{
> + uint16_t cap = 0;
> +
> + if (losc != 2)
> + return false;
> +
> + l2cap_frame_get_le16(frame, &cap);
> +
> + print_field("%*cUnknown: 0x%04x", BASE_INDENT + 2, ' ', cap);
> +
> + return true;
> +}
> +
> static bool codec_vendor_cap(uint8_t losc, struct l2cap_frame *frame)
> {
> uint32_t vendor_id = 0;
> @@ -524,6 +542,8 @@ static bool codec_vendor_cap(uint8_t losc, struct
> l2cap_frame *frame)
>
> if (vendor_id == APTX_VENDOR_ID && codec_id == APTX_CODEC_ID) {
> codec_vendor_aptx_cap(losc, frame);
> + } else if (vendor_id == LDAC_VENDOR_ID && codec_id == LDAC_CODEC_ID) {
> + codec_vendor_ldac(losc, frame);
Should this return value from function? Otherwise you may silently ignore
data if length doesn't match.
> } else {
> packet_hexdump(frame->data, losc);
> l2cap_frame_pull(frame, frame, losc);
> @@ -573,6 +593,8 @@ static bool codec_vendor_cfg(uint8_t losc, struct
> l2cap_frame *frame)
>
> if (vendor_id == APTX_VENDOR_ID && codec_id == APTX_CODEC_ID) {
> codec_vendor_aptx_cfg(losc, frame);
> + } else if (vendor_id == LDAC_VENDOR_ID && codec_id == LDAC_CODEC_ID) {
> + codec_vendor_ldac(losc, frame);
> } else {
> packet_hexdump(frame->data, losc);
> l2cap_frame_pull(frame, frame, losc);
--
pozdrawiam
Szymon Janc
next prev parent reply other threads:[~2015-11-20 16:40 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-20 14:13 [PATCH v2 00/22] Add AVDTP/A2DP decoding to btmon Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 01/22] monitor/l2cap: Add channel sequence number Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 02/22] monitor/avdtp: Add basic decoding of AVDTP signalling Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 03/22] monitor/avdtp: Decode AVDTP_DISCOVER Andrzej Kaczmarek
2015-11-20 16:50 ` Szymon Janc
2015-11-20 14:13 ` [PATCH v2 04/22] monitor/avdtp: Decode AVDTP_GET_CAPABILITIES Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 05/22] monitor/avdtp: Decode AVDTP_SET_CONFIGURATION Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 06/22] monitor/avdtp: Decode AVDTP_GET_CONFIGURATION Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 07/22] monitor/avdtp: Decode AVDTP_RECONFIGURE Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 08/22] monitor/avdtp: Decode AVDTP_OPEN Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 09/22] monitor/avdtp: Decode AVDTP_START Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 10/22] monitor/avdtp: Decode AVDTP_CLOSE Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 11/22] monitor/avdtp: Decode AVDTP_SUSPEND Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 12/22] monitor/avdtp: Decode AVDTP_ABORT Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 13/22] monitor/avdtp: Decode AVDTP_SECURITY_CONTROL Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 14/22] monitor/avdtp: Decode AVDTP_GET_ALL_CAPABILITIES Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 15/22] monitor/avdtp: Decode AVDTP_DELAYREPORT Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 16/22] monitor/avdtp: Decode basic Media Codec capabilities Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 17/22] monitor/avdtp: Decode basic Content Protection capabilities Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 18/22] monitor/a2dp: Decode SBC capabilities Andrzej Kaczmarek
2015-11-20 16:35 ` Szymon Janc
2015-11-20 14:13 ` [PATCH v2 19/22] monitor/a2dp: Decode MPEG-1,2 capabilities Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 20/22] monitor/a2dp: Decode AAC capabilities Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 21/22] monitor/a2dp: Decode aptX capabilities Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 22/22] monitor/a2dp: Decode LDAC capabilities Andrzej Kaczmarek
2015-11-20 16:40 ` Szymon Janc [this message]
2015-11-20 16:37 ` [PATCH v2 00/22] Add AVDTP/A2DP decoding to btmon Andrzej Kaczmarek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1486854.e8g2EASchL@ix \
--to=szymon.janc@codecoup.pl \
--cc=andrzej.kaczmarek@codecoup.pl \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).