Skip to contentSkip to conversation

more sdp patches

Bluez-devel Collin R. Mulliner 2 participants 6 messages Dec 2, 2005 – Dec 4, 2005 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi Marcel,

here is another patch for bluez-libs for sdp. I added:

int sdp_set_access_protos_attr(sdp_record_t *rec, const sdp_list_t *proto, const uint16_t attr);

this is to add stuff like SDP_ATTR_ADD_PROTO_DESC_LIST, actually I modified sdp_set_access_protos to take another parameter and made sdp_set_access_protos do a call to sdp_set_access_protos_attr to keep backward compatibility

... Collin

--
Collin R. Mulliner <[email protected]>
BETAVERSiON Systems [www.betaversion.net]
info/pgp: finger [email protected]
USS Enterprise Bumperstricker: Our other starship separates into 3 pieces!

include/sdp_lib.h +1 -0
@@ -172,6 +174,7 @@
  * Set the access protocols of the record to those specified in proto
  */
 int sdp_set_access_protos(sdp_record_t *rec, const sdp_list_t *proto);
+int sdp_set_access_protos_attr(sdp_record_t *rec, const sdp_list_t *proto, const uint16_t attr);
 
 /*
  * Get protocol port (i.e. PSM for L2CAP, Channel for RFCOMM) 
src/sdp.c +6 -1
@@ -1742,6 +1772,11 @@
  */
 int sdp_set_access_protos(sdp_record_t *rec, const sdp_list_t *ap)
 {
+	return(sdp_set_access_protos_attr(rec, ap, SDP_ATTR_PROTO_DESC_LIST));
+}
+
+int sdp_set_access_protos_attr(sdp_record_t *rec, const sdp_list_t *ap, const uint16_t attr)
+{
 	const sdp_list_t *p;
 	sdp_data_t *protos = 0;
 
@@ -1749,7 +1784,7 @@
 		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);
+	sdp_attr_add(rec, attr, protos);
 	return 0;
 }
 
maintainer
#1 lore raw

Hi Collin,

Quoted 9 lines

here is another patch for bluez-libs for sdp. I added:

int sdp_set_access_protos_attr(sdp_record_t *rec, const sdp_list_t *proto, const uint16_t attr);

this is to add stuff like SDP_ATTR_ADD_PROTO_DESC_LIST, actually I modified sdp_set_access_protos to take another parameter and made sdp_set_access_protos do a call to sdp_set_access_protos_attr to keep backward compatibility

this won't work, because the additional protocol descriptor list is a sequence of sequence of sequence. Compare this from my HCRP capable printer:

Attribute 0x0004 - ProtocolDescriptorList

        Sequence
                Sequence
                        UUID16 0x0100 - L2CAP
                        UINT16 0x1003
                Sequence
                       UUID16 0x0012 - HardcopyControlChannel

Attribute 0x000d - AdditionalProtocolDescriptorLists

        Sequence
                Sequence
                        Sequence
                                UUID16 0x0100 - L2CAP
                                UINT16 0x1001
                        Sequence
                                UUID16 0x0014 - HardcopyDataChannel

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw

Marcel,

Quoting Marcel Holtmann <[email protected]>:

Quoted 3 lines

this won't work, because the additional protocol descriptor list is a sequence of sequence of sequence. Compare this from my HCRP capable printer:

ah mmmh the code I send in works for me, so maybe it's just unclean :-(

About the "leng" issue, I thought you would tweak my patch anyway so I didn't bothered making it nice ... sorry!

... Collin

-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#3 lore raw

Hi Collin,

Quoted 5 lines
Quoted 3 lines

this won't work, because the additional protocol descriptor list is a sequence of sequence of sequence. Compare this from my HCRP capable printer:

ah mmmh the code I send in works for me, so maybe it's just unclean :-(

show me how you use it.

Quoted 2 lines

About the "leng" issue, I thought you would tweak my patch anyway so I didn't bothered making it nice ... sorry!

Make it looks nice and re-send it. I like nice looking patches ;)

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#4 lore raw

Hi Marcel,

Quoted 9 lines · Marcel Holtmann

Hi Collin,

Quoted 5 lines
Quoted 3 lines

this won't work, because the additional protocol descriptor list is a sequence of sequence of sequence. Compare this from my HCRP capable printer:

ah mmmh the code I send in works for me, so maybe it's just unclean :-(

show me how you use it.

you were right, it doesn't work. sdptool browse just did somehow display it, but of course the third sequence did not exist ...

*remember: Marcel is always right when talking about BlueZ stuff*

so I guess I have to write my own function to do
SDP_ATTR_ADD_PROTO_DESC_LIST?

Quoted 4 lines
Quoted 2 lines

About the "leng" issue, I thought you would tweak my patch anyway so I didn't bothered making it nice ... sorry!

Make it looks nice and re-send it. I like nice looking patches ;)

I will, I just need to finish some other stuff now

... Collin

--
Collin R. Mulliner <[email protected]> BETAVERSiON Systems [www.betaversion.net] info/pgp: finger [email protected] AAAAA - American Association Against Acronym Abuse

-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#5 lore raw

Hi Collin,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

this won't work, because the additional protocol descriptor list is a sequence of sequence of sequence. Compare this from my HCRP capable printer:

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

ah mmmh the code I send in works for me, so maybe it's just unclean :-(

show me how you use it.

you were right, it doesn't work. sdptool browse just did somehow display it, but of course the third sequence did not exist ...

*remember: Marcel is always right when talking about BlueZ stuff*

not always, but I already ran into this problem when I wrote the CUPS backend with HCRP support some time ago. And actually HID is the same.

Quoted 2 lines

so I guess I have to write my own function to do
SDP_ATTR_ADD_PROTO_DESC_LIST?

Please do so.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

About the "leng" issue, I thought you would tweak my patch anyway so I didn't bothered making it nice ... sorry!

Make it looks nice and re-send it. I like nice looking patches ;)

I will, I just need to finish some other stuff now

My plan was to do another release this weekend, but it got postponed due some timing issues. However I will do a new release early next week and I actually like to see this patches included.

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel