public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: "Frédéric Dalleau" <frederic.dalleau@access-company.com>
To: BlueZ development <bluez-devel@lists.sourceforge.net>
Subject: [Bluez-devel] UNITINFO and SUBUNITINFO in avrcp
Date: Wed, 16 Jan 2008 15:25:49 +0100	[thread overview]
Message-ID: <478E13ED.3060506@access-company.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 241 bytes --]

This little patch enables support of UNITINFO and SUBUNITINFO commands 
in audio service.
The implementation is not very useful itself but it is mandatory in AVRCP.

PTS has some test cases to check for it.

Comments are welcome!

Frédéric.

[-- Attachment #2: unitinfo.patch --]
[-- Type: text/x-patch, Size: 756 bytes --]

diff --git a/audio/control.c b/audio/control.c
index bb3f2bf..5eb1053 100644
--- a/audio/control.c
+++ b/audio/control.c
@@ -643,6 +643,19 @@ static gboolean session_cb(GIOChannel *chan, GIOCondition cond,
 		ret = write(session->sock, buf, packet_size);
 	}
 
+	if (avctp->packet_type == AVCTP_PACKET_SINGLE &&
+		   avctp->cr == AVCTP_COMMAND &&
+		   avctp->pid == htons(AV_REMOTE_SVCLASS_ID) &&
+		   avrcp->code == CTYPE_STATUS &&
+		   (avrcp->opcode == OP_UNITINFO
+		   	|| avrcp->opcode == OP_SUBUNITINFO)) {
+		avctp->cr = AVCTP_RESPONSE;
+		avrcp->code = CTYPE_STABLE;
+		debug("reply to %s", avrcp->opcode == OP_UNITINFO ?
+				"OP_UNITINFO" : "OP_SUBUNITINFO");
+		ret = write(session->sock, buf, packet_size);
+	}
+
 	return TRUE;
 
 failed:

[-- Attachment #3: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

             reply	other threads:[~2008-01-16 14:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-16 14:25 Frédéric Dalleau [this message]
2008-01-16 19:18 ` [Bluez-devel] UNITINFO and SUBUNITINFO in avrcp Marcel Holtmann

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=478E13ED.3060506@access-company.com \
    --to=frederic.dalleau@access-company.com \
    --cc=bluez-devel@lists.sourceforge.net \
    /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