linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bluez-devel] avrcp start
@ 2005-11-29 17:24 Brad Midgley
  2005-11-29 20:37 ` Marcel Holtmann
  0 siblings, 1 reply; 5+ messages in thread
From: Brad Midgley @ 2005-11-29 17:24 UTC (permalink / raw)
  To: bluez-devel

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

Hi

I've started an avrcp receiver in the btsco cvs.

I hope it doesn't seem like a case of extreme laziness to put the sdp
stuff in sdptool. I suppose I should get serious and put it in my app
too. Did I write the patch right with regard to protocol names, etc?

Also, is there a separate UUID for AVRCP? I only found AVCTP UUID
definitions, but it seems like PID in the AVCTP header needs to indicate
AVRCP specifically.

With the changes above, I got my headset to connect but it seems to put
in the value "0e11" for the pid in the first AVRCP packet I got out of it.

Brad

[-- Attachment #2: sdptool-avrcp.patch --]
[-- Type: text/x-patch, Size: 2633 bytes --]

Index: tools/sdptool.c
===================================================================
RCS file: /cvsroot/bluez/utils/tools/sdptool.c,v
retrieving revision 1.35
diff -u -r1.35 sdptool.c
--- tools/sdptool.c	16 Sep 2005 04:18:46 -0000	1.35
+++ tools/sdptool.c	29 Nov 2005 17:16:38 -0000
@@ -2052,6 +2052,65 @@
 	return ret;
 }
 
+static int add_avrcp(sdp_session_t *session, svc_info_t *si)
+{
+	sdp_list_t *svclass_id, *pfseq, *apseq, *root;
+	uuid_t root_uuid, l2cap, avdtp, a2snk;
+	sdp_profile_desc_t profile[1];
+	sdp_list_t *aproto, *proto[2];
+	sdp_record_t record;
+	sdp_data_t *psm, *version;
+	uint16_t lp = 0x0019, ver = 0x0100;
+	int ret = 0;
+
+	memset((void *)&record, 0, sizeof(sdp_record_t));
+	record.handle = 0xffffffff;
+	sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);
+	root = sdp_list_append(0, &root_uuid);
+	sdp_set_browse_groups(&record, root);
+
+	sdp_uuid16_create(&a2snk, AV_REMOTE_TARGET_SVCLASS_ID);
+	svclass_id = sdp_list_append(0, &a2snk);
+	sdp_set_service_classes(&record, svclass_id);
+
+	sdp_uuid16_create(&profile[0].uuid, AV_REMOTE_TARGET_PROFILE_ID);
+	profile[0].version = 0x0100;
+	pfseq = sdp_list_append(0, &profile[0]);
+	sdp_set_profile_descs(&record, pfseq);
+
+	sdp_uuid16_create(&l2cap, L2CAP_UUID);
+	proto[0] = sdp_list_append(0, &l2cap);
+	psm = sdp_data_alloc(SDP_UINT16, &lp);
+	proto[0] = sdp_list_append(proto[0], psm);
+	apseq = sdp_list_append(0, proto[0]);
+
+	sdp_uuid16_create(&avdtp, AVDTP_UUID);
+	proto[1] = sdp_list_append(0, &avdtp);
+	version = sdp_data_alloc(SDP_UINT16, &ver);
+	proto[1] = sdp_list_append(proto[1], version);
+	apseq = sdp_list_append(apseq, proto[1]);
+
+	aproto = sdp_list_append(0, apseq);
+	sdp_set_access_protos(&record, aproto);
+
+	sdp_set_info_attr(&record, "AVRCP TG", 0, 0);
+
+	if (sdp_device_record_register(session, &interface, &record, SDP_RECORD_PERSIST) < 0) {
+		printf("Service Record registration failed\n");
+		ret = -1;
+		goto done;
+	}
+
+	printf("AVRCP service registered\n");
+
+done:
+	sdp_list_free(proto[0], 0);
+	sdp_list_free(proto[1], 0);
+	sdp_list_free(apseq, 0);
+	sdp_list_free(aproto, 0);
+	return ret;
+}
+
 static unsigned char syncml_uuid[] = {	0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x10, 0x00,
 					0x80, 0x00, 0x00, 0x02, 0xEE, 0x00, 0x00, 0x02 };
 
@@ -2350,6 +2409,8 @@
 	{ "A2SRC",	AUDIO_SOURCE_SVCLASS_ID,	add_a2source	},
 	{ "A2SNK",	AUDIO_SINK_SVCLASS_ID,		add_a2sink	},
 
+	{ "AVRCP",      AV_REMOTE_TARGET_SVCLASS_ID,    add_avrcp       },
+
 	{ "SYNCML",	0,				add_syncml,	syncml_uuid	},
 	{ "ACTIVESYNC",	0,				add_activesync,	async_uuid	},
 	{ "HOTSYNC",	0,				add_hotsync,	hotsync_uuid	},

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-devel] avrcp start
  2005-11-29 17:24 [Bluez-devel] avrcp start Brad Midgley
@ 2005-11-29 20:37 ` Marcel Holtmann
  2005-11-29 22:38   ` Brad Midgley
  0 siblings, 1 reply; 5+ messages in thread
From: Marcel Holtmann @ 2005-11-29 20:37 UTC (permalink / raw)
  To: bluez-devel

Hi Brad,

> I've started an avrcp receiver in the btsco cvs.
> 
> I hope it doesn't seem like a case of extreme laziness to put the sdp
> stuff in sdptool. I suppose I should get serious and put it in my app
> too. Did I write the patch right with regard to protocol names, etc?
> 
> Also, is there a separate UUID for AVRCP? I only found AVCTP UUID
> definitions, but it seems like PID in the AVCTP header needs to indicate
> AVRCP specifically.
> 
> With the changes above, I got my headset to connect but it seems to put
> in the value "0e11" for the pid in the first AVRCP packet I got out of it.

you actually copied to much from on of the A2DP record handlers. The
specification definces the AVRCP CT service record like this:

        Attribute 0x0000 - ServiceRecordHandle
                UINT32 0x00010000
        Attribute 0x0001 - ServiceClassIDList
                Sequence
                        UUID16 0x110e - RemoteControl
        Attribute 0x0004 - ProtocolDescriptorList
                Sequence
                        Sequence
                                UUID16 0x0100 - L2CAP
                                UINT16 0x0017
                        Sequence
                                UUID16 0x0017 - AVCTP
                                UINT16 0x0100
        Attribute 0x0005 - BrowseGroupList
                Sequence
                        UUID16 0x1002 - PublicBrowseGroup
        Attribute 0x0009 - BluetoothProfileDescriptorList
                Sequence
                        Sequence
                                UUID16 0x110e - RemoteControl
                                UINT16 0x0100
        Attribute 0x0100
                String AVRCP CT
        Attribute 0x0311
                UINT16 0x000f

You need the supported features attribute. The correct PSM and protocol
and profile descriptors. The AVRCP TG looks like this:

        Attribute 0x0000 - ServiceRecordHandle
                UINT32 0x00010001
        Attribute 0x0001 - ServiceClassIDList
                Sequence
                        UUID16 0x110c - RemoteControlTarget
        Attribute 0x0004 - ProtocolDescriptorList
                Sequence
                        Sequence
                                UUID16 0x0100 - L2CAP
                                UINT16 0x0017
                        Sequence
                                UUID16 0x0017 - AVCTP
                                UINT16 0x0100
        Attribute 0x0005 - BrowseGroupList
                Sequence
                        UUID16 0x1002 - PublicBrowseGroup
        Attribute 0x0009 - BluetoothProfileDescriptorList
                Sequence
                        Sequence
                                UUID16 0x110e - RemoteControl
                                UINT16 0x0100
        Attribute 0x0100
                String AVRCP TG
        Attribute 0x0311
                UINT16 0x000f

Functions for both records are in the CVS now.

Regards

Marcel




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-devel] avrcp start
  2005-11-29 20:37 ` Marcel Holtmann
@ 2005-11-29 22:38   ` Brad Midgley
  2005-11-30  2:08     ` Brad Midgley
  0 siblings, 1 reply; 5+ messages in thread
From: Brad Midgley @ 2005-11-29 22:38 UTC (permalink / raw)
  To: bluez-devel

Marcel

> you actually copied to much from on of the A2DP record handlers. The
> specification definces the AVRCP CT service record like this:
> You need the supported features attribute. The correct PSM and protocol
> and profile descriptors.

> Functions for both records are in the CVS now.

thanks for straightening it out on sdp.

so I am making progress like I did with hammering out a2dp but i'm a
little stuck. I am not finding constants for anything they talk about in
AVRCP. Things like play/track back/track forward operands, opcodes for
using passthrough, what the significance of "sub unit type 9" is... am I
missing something? None of it appears in assigned numbers either.

brad


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-devel] avrcp start
  2005-11-29 22:38   ` Brad Midgley
@ 2005-11-30  2:08     ` Brad Midgley
  2005-11-30  3:29       ` Marcel Holtmann
  0 siblings, 1 reply; 5+ messages in thread
From: Brad Midgley @ 2005-11-30  2:08 UTC (permalink / raw)
  To: bluez-devel

guys

> little stuck. I am not finding constants for anything they talk about in
> AVRCP. Things like play/track back/track forward operands, opcodes 

i just found the snippet in the docs about how they piggyback on 1394
for a lot of this stuff, so now i'm digging there. if nothing else, i'll
look for the constants in the linux 1394 headers.

brad


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-devel] avrcp start
  2005-11-30  2:08     ` Brad Midgley
@ 2005-11-30  3:29       ` Marcel Holtmann
  0 siblings, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2005-11-30  3:29 UTC (permalink / raw)
  To: bluez-devel

Hi Brad,

> > little stuck. I am not finding constants for anything they talk about in
> > AVRCP. Things like play/track back/track forward operands, opcodes 
> 
> i just found the snippet in the docs about how they piggyback on 1394
> for a lot of this stuff, so now i'm digging there. if nothing else, i'll
> look for the constants in the linux 1394 headers.

if I am not mistaken, they refer to a document that you might can get if
you ask nicely. However it is not part of the Bluetooth specification.

Regards

Marcel




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-11-30  3:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-29 17:24 [Bluez-devel] avrcp start Brad Midgley
2005-11-29 20:37 ` Marcel Holtmann
2005-11-29 22:38   ` Brad Midgley
2005-11-30  2:08     ` Brad Midgley
2005-11-30  3:29       ` Marcel Holtmann

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).