linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bluez-users] Re: adding Additional Protocol Descriptor List
@ 2005-12-14  7:30 Arch Sayo
  2005-12-14  7:41 ` Marcel Holtmann
  0 siblings, 1 reply; 7+ messages in thread
From: Arch Sayo @ 2005-12-14  7:30 UTC (permalink / raw)
  To: bluez-users

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

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 

[-- Attachment #2: Type: text/html, Size: 5693 bytes --]

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

end of thread, other threads:[~2005-12-20  0:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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