From: "Pali Rohár" <pali.rohar@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH] avinfo: Dump unknown codecs and unknown categories
Date: Sat, 26 Jan 2019 11:24:50 +0100 [thread overview]
Message-ID: <20190126102450.23851-1-pali.rohar@gmail.com> (raw)
---
tools/avinfo.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/tools/avinfo.c b/tools/avinfo.c
index a3298e8c8..42f539f43 100644
--- a/tools/avinfo.c
+++ b/tools/avinfo.c
@@ -648,6 +648,8 @@ static void print_media_codec(
struct avdtp_media_codec_capability *cap,
uint8_t size)
{
+ int i;
+
if (size < sizeof(*cap)) {
printf("\tMedia Codec: Unknown (broken)\n");
return;
@@ -668,6 +670,10 @@ static void print_media_codec(
break;
default:
printf("\tMedia Codec: Unknown\n");
+ printf("\t\tCodec Data:");
+ for (i = 0; i < size - 2; ++i)
+ printf(" 0x%.02x", ((unsigned char *)cap->data)[i]);
+ printf("\n");
}
}
@@ -699,6 +705,7 @@ static void print_content_protection(
static void print_caps(void *data, int size)
{
int processed;
+ int i;
for (processed = 0; processed + 2 < size;) {
struct avdtp_service_capability *cap;
@@ -715,9 +722,14 @@ static void print_caps(void *data, int size)
case AVDTP_REPORTING:
case AVDTP_RECOVERY:
case AVDTP_MULTIPLEXING:
- default:
/* FIXME: Add proper functions */
+ break;
+ default:
printf("\tUnknown category: %d\n", cap->category);
+ printf("\t\tData:");
+ for (i = 0; i < cap->length; ++i)
+ printf(" 0x%.02x", ((unsigned char *)cap->data)[i]);
+ printf("\n");
break;
case AVDTP_MEDIA_CODEC:
print_media_codec((void *) cap->data, cap->length);
--
2.11.0
next reply other threads:[~2019-01-26 10:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-26 10:24 Pali Rohár [this message]
2019-01-31 10:50 ` [PATCH] avinfo: Dump unknown codecs and unknown categories Luiz Augusto von Dentz
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=20190126102450.23851-1-pali.rohar@gmail.com \
--to=pali.rohar@gmail.com \
--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).