From: Brad Midgley <bmidgley@xmission.com>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] avrcp start
Date: Tue, 29 Nov 2005 10:24:46 -0700 [thread overview]
Message-ID: <438C8EDE.1010309@xmission.com> (raw)
[-- 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 },
next reply other threads:[~2005-11-29 17:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-29 17:24 Brad Midgley [this message]
2005-11-29 20:37 ` [Bluez-devel] avrcp start Marcel Holtmann
2005-11-29 22:38 ` Brad Midgley
2005-11-30 2:08 ` Brad Midgley
2005-11-30 3:29 ` 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=438C8EDE.1010309@xmission.com \
--to=bmidgley@xmission.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.