All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: bluez-users@lists.sourceforge.net
Subject: Re: [Bluez-users] Re: adding Additional Protocol Descriptor List
Date: Wed, 14 Dec 2005 10:29:06 +0100	[thread overview]
Message-ID: <1134552546.14885.26.camel@localhost> (raw)
In-Reply-To: <1134546080.14885.24.camel@localhost>

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

Hi Arch,

> > I have tried writing code to add the Additional Protocol Descriptor
> > List. But it seems that the data still cannot be added as a 3-level
> > sequence (sequence of a sequence of a sequence). The data I added for
> > the Additional Protocol Descriptor List still look similar to the
> > Protocol Descriptor List (2-level sequence of data).
> 
> you should coordinate with Collin, because he also needs this.

forget about that. I did the patch by myself. Feel free to try it out.

Regards

Marcel


[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 2142 bytes --]

Index: include/sdp_lib.h
===================================================================
RCS file: /cvsroot/bluez/libs/include/sdp_lib.h,v
retrieving revision 1.12
diff -u -r1.12 sdp_lib.h
--- include/sdp_lib.h	9 Dec 2005 09:12:44 -0000	1.12
+++ include/sdp_lib.h	14 Dec 2005 09:27:40 -0000
@@ -176,6 +176,11 @@
 int sdp_set_access_protos(sdp_record_t *rec, const sdp_list_t *proto);
 
 /*
+ * Set the additional access protocols of the record to those specified in proto
+ */
+int sdp_set_add_access_protos(sdp_record_t *rec, const sdp_list_t *proto);
+
+/*
  * Get protocol port (i.e. PSM for L2CAP, Channel for RFCOMM) 
  */
 int sdp_get_proto_port(const sdp_list_t *list, int proto);
@@ -457,7 +462,7 @@
 /*
  * Get the additional access protocols from the service record
  */
-int sdp_get_add_access_protos(const sdp_record_t *rec, sdp_list_t **pap);
+int sdp_get_add_access_protos(const sdp_record_t *rec, sdp_list_t **protos);
 
 /*
  * Extract the list of browse groups to which the service belongs.
Index: src/sdp.c
===================================================================
RCS file: /cvsroot/bluez/libs/src/sdp.c,v
retrieving revision 1.33
diff -u -r1.33 sdp.c
--- src/sdp.c	9 Dec 2005 09:39:16 -0000	1.33
+++ src/sdp.c	14 Dec 2005 09:27:41 -0000
@@ -1812,13 +1812,31 @@
 int sdp_set_access_protos(sdp_record_t *rec, const sdp_list_t *ap)
 {
 	const sdp_list_t *p;
-	sdp_data_t *protos = 0;
+	sdp_data_t *protos = NULL;
 
 	for (p = ap; p; p = p->next) {
-		sdp_data_t *seq = access_proto_to_dataseq(rec, (sdp_list_t *)p->data);
+		sdp_data_t *seq = access_proto_to_dataseq(rec, (sdp_list_t *) p->data);
 		protos = sdp_seq_append(protos, seq);
 	}
+
 	sdp_attr_add(rec, SDP_ATTR_PROTO_DESC_LIST, protos);
+
+	return 0;
+}
+
+int sdp_set_add_access_protos(sdp_record_t *rec, const sdp_list_t *ap)
+{
+	const sdp_list_t *p;
+	sdp_data_t *protos = NULL;
+
+	for (p = ap; p; p = p->next) {
+		sdp_data_t *seq = access_proto_to_dataseq(rec, (sdp_list_t *) p->data);
+		protos = sdp_seq_append(protos, seq);
+	}
+
+	sdp_attr_add(rec, SDP_ATTR_ADD_PROTO_DESC_LIST,
+				sdp_data_alloc(SDP_SEQ8, protos));
+
 	return 0;
 }
 

  reply	other threads:[~2005-12-14  9:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-14  7:30 [Bluez-users] Re: adding Additional Protocol Descriptor List Arch Sayo
2005-12-14  7:41 ` Marcel Holtmann
2005-12-14  9:29   ` Marcel Holtmann [this message]
2005-12-15  8:35     ` [Bluez-users] just asking oj ravadilla
2005-12-15  8:52       ` Marcel Holtmann
2005-12-20  0:32         ` [Bluez-users] marcel@holtmann.org oj ravadilla
2005-12-20  0:46           ` 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=1134552546.14885.26.camel@localhost \
    --to=marcel@holtmann.org \
    --cc=bluez-users@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.