Return-Path: Message-ID: <20051214073020.77669.qmail@web32409.mail.mud.yahoo.com> From: Arch Sayo To: bluez-users@lists.sourceforge.net MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1249044936-1134545420=:77324" Subject: [Bluez-users] Re: adding Additional Protocol Descriptor List Sender: bluez-users-admin@lists.sourceforge.net Errors-To: bluez-users-admin@lists.sourceforge.net Reply-To: bluez-users@lists.sourceforge.net List-Unsubscribe: , List-Id: BlueZ users List-Post: List-Help: List-Subscribe: , List-Archive: Date: Tue, 13 Dec 2005 23:30:20 -0800 (PST) --0-1249044936-1134545420=:77324 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi Marcel, 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). Here is the code corresponding to adding the SDP attribute: int sdp_set_add_access_protos(sdp_record_t *rec, const sdp_list_t *ap) { const sdp_list_t *p; const sdp_list_t *pp; sdp_data_t *protos = 0; for (p = ap->data; p; p = p->next) { sdp_data_t *seq = access_proto_to_dataseq2(rec, (sdp_list_t *)p->data); protos = sdp_seq_append(protos, seq); // protos = seq; } sdp_attr_add(rec, SDP_ATTR_ADD_PROTO_DESC_LIST, protos); return 0; } int add_additional_proto(void) { /* Add Additional Protocol Descriptor List */ sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID); proto2[0] = sdp_list_append(0, &l2cap_uuid); apseq3 = sdp_list_append(0, proto2[0]); apseq2 = sdp_list_append(0, apseq3); sdp_uuid16_create(&rfcomm_uuid, RFCOMM_UUID); proto2[1] = sdp_list_append(0, &rfcomm_uuid); channel2 = sdp_data_alloc(SDP_UINT8, &chan2); proto2[1] = sdp_list_append(proto2[1], channel2); apseq3 = sdp_list_append(apseq3, proto2[1]); sdp_uuid16_create(&obex_uuid, OBEX_UUID); proto2[2] = sdp_list_append(0, &obex_uuid); apseq3 = sdp_list_append(apseq3, proto2[2]); addproto = sdp_list_append(0, apseq3); sdp_set_add_access_protos(&record, addproto); return 0; } As you can see, I changed the attribute ID to correspond to SDP_ATTR_ADD_PROTO_DESC_LIST (0x000d) in the sdp_set_add_access_protos(). However, the data was not added correctly. I would like to ask in what other parts of the code should I make corresponding changes to add the sdp data correctly. Thank you for your time and efforts. Arch Sayo Hi Arch, > Thank you with that information on adding the 1284ID attribute. you are welcome. I assume it is working perfect now. > Now, I am trying to add the Additional Protocol Descriptor List to my > sdp record. The Additional Protocol Descriptor List is almost similar > to the Protocol Descriptor List. The only difference is that while the > Protocol Descriptor List is a sequence of a sequence of data (2 > levels), the Additional Protocol Descriptor List is a sequence of a > sequence of a sequence of data (3 levels) .I tried doing this using > the function sdp_set_access_protos() and just substituting the > Attribute ID in the function from SDP_ATTR_PROTO_DESC_LIST to > SDP_ATTR_ADD_PROTO_DESC_LIST. However, as you may already know, this > will not solve it since the Protocol Descriptor List is only a > sequence of a sequence. > > In this regard, I would like to ask how I will be able to add a > sequence of a sequence of a sequence of data to my sdp record. Or in > other words, how will I add the Additional Protocol Descriptor List to > my sdp record. And again Collin already ran into the same problem, because you also need them for HID. So I think we need a sdp_set_add_access_protos() function for this job. Feel free to send me a patch. Regards Marcel --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping --0-1249044936-1134545420=:77324 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
Hi Marcel,
 
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).
 
Here is the code corresponding to adding the SDP attribute:
 
int sdp_set_add_access_protos(sdp_record_t *rec, const sdp_list_t *ap)
{
      const sdp_list_t *p;
  const sdp_list_t *pp;
  sdp_data_t *protos = 0;

 
  for (p = ap->data; p; p = p->next) {
    sdp_data_t *seq = access_proto_to_dataseq2(rec, (sdp_list_t *)p->data);
    protos = sdp_seq_append(protos, seq);  // protos = seq;
  }

  sdp_attr_add(rec, SDP_ATTR_ADD_PROTO_DESC_LIST, protos);
  return 0;
}


int add_additional_proto(void)
{

   /* Add Additional Protocol Descriptor List */
   sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID);
   proto2[0] = sdp_list_append(0, &l2cap_uuid);
   apseq3 = sdp_list_a ppend(0, proto2[0]);
   apseq2 = sdp_list_append(0, apseq3);

   sdp_uuid16_create(&rfcomm_uuid, RFCOMM_UUID);
   proto2[1] = sdp_list_append(0, &rfcomm_uuid);

   channel2 = sdp_data_alloc(SDP_UINT8, &chan2);
   proto2[1] = sdp_list_append(proto2[1], channel2);
   apseq3 = sdp_list_append(apseq3, proto2[1]);
 
   sdp_uuid16_create(&obex_uuid, OBEX_UUID);
   proto2[2] = sdp_list_append(0, &obex_uuid);
   apseq3 = sdp_list_append(apseq3, proto2[2]);
< SPAN style="mso-spacerun: yes"> 
   addproto = sdp_list_append(0, apseq3);

   sdp_set_add_access_protos(&record, addproto);
 
   return 0;
}

 
As you can see, I changed the attribute ID to correspond to SDP_ATTR_ADD_PROTO_DESC_LIST (0x000d) in the sdp_set_add_access_protos(). However, the data was not added correctly. I would like to ask in what other parts of the code should I make corresponding changes to add the sdp data correctly.
 
Thank you for your time and efforts.
 
Arch Sayo
 
 
Hi Arch,

> Thank you with that information on adding the 1284ID
attribute.

you are welcome. I assume it is working perfect now.

> Now, I am trying to add the Additional Protocol
Descriptor List to my
> sdp record. The Additional Protocol Descriptor List
is almost similar
> to the Protocol Descriptor List. The only difference
is that while the
> Protocol Descriptor List is a sequence of a sequence
of data (2
> levels),  the Additional Protocol Descriptor List is
a sequence of a
> sequence of a sequence of data (3 levels) .I tried
doing this using
> the function sdp_set_access_protos() and just
substituting the
> Attribute ID in the function from
SDP_ATTR_PROTO_DESC_LIST to
> SDP_ATTR_ADD_PROTO_DESC_LIST. However, as you may
already know, this
> will not solve it since the Protocol Descriptor List
is only a
> sequence of a sequence.

> In this regard, I would like to ask how I will be
able to add a
> sequence of a sequence of a sequence of data to my
sdp record. Or in
> other words, how will I add the Additional Protocol
Descriptor List to
> my sdp record.

And again Collin already ran into the same problem,
because you also
need them for HID. So I think we need a
sdp_set_add_access_protos()
function for this job. Feel free to send me a patch.

Regards

Marcel


Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping --0-1249044936-1134545420=:77324-- ------------------------------------------------------- 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-users mailing list Bluez-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-users